Python os.fpathconf() Method
Example
Get the maximum length of a file :
#Import os Library
import os
# open a file and create a file descriptor
fd = os.open("test.txt", os.O_RDONLY)
#Get the maximum length of a filename
print (os.fpathconf(fd, 'PC_NAME_MAX'))
#close file
os.close(fd)
Run Code »
Definition and Usage
The os.fpathconf()
method used to return the system configuration information relevant to an open file.
Note: Available only on UNIX platforms.
Syntax
os.fpathconf(fd, name)
Parameter Values
Parameter | Description |
---|---|
fd | Required. Specifies a file descriptor |
name | Required. The configuration value to retrieve. Usually the name of a
defined system value |
Technical Details
Return Value: | An int value, representing system configuration information |
---|---|
Python Version: | pre-2.6 |
Change Log: | 3.3: This method is equivalent to os.pathconf(fd, name) |