← 返回列表

Python3 os 模块 Pathconf 方法

Python3 os 模块 Pathconf 方法 #!/usr/bin/python3 import os, sys print ("%s" % os.pathconf_names) # Retrieve maximum length of a filename no = os.pathconf('a2.py', 'PC_NAME_MAX') print ("Maximum length of a filename :%d" % no) # Retrieve file size no = os.pathconf('a2.py', 'PC_FILESIZEBITS') print ("file size in bits :%d" % no)

Python3 os 模块 Pathconf 方法

#!/usr/bin/python3
import os, sys

print ("%s" % os.pathconf_names)

# Retrieve maximum length of a filename
no = os.pathconf('a2.py', 'PC_NAME_MAX')
print ("Maximum length of a filename :%d" % no)

# Retrieve file size
no = os.pathconf('a2.py', 'PC_FILESIZEBITS')
print ("file size in bits  :%d" % no)

打开资源 ↗

交流与评论