How to get the maximum file name length limit using Python?

PythonServer Side ProgrammingProgramming

On some platforms, the maximum filename length varies according to the location on the disk. If you run UNIX with different filesystems mounted in various locations on your directory tree, you might see the following values for the maximum filename length in those locations:

>>> import statvfs, os
>>> os.statvfs('/')[statvfs.F_NAMEMAX]
4032
>>> os.statvfs('/boot')[statvfs.F_NAMEMAX]
255
raja
Published on 28-Dec-2017 11:27:21
Advertisements