二十五岁时我们都一样愚蠢、多愁善感,喜欢故弄玄虚,可如果不那样的话,五十岁时也就不会如此明智。
标题:Python3 os 模块 Fpathconf 方法
Python3 os 模块 Fpathconf 方法
#!/usr/bin/python3 import os, sys # Open a file fd = os.open( "foo.txt", os.O_RDWR|os.O_CREAT ) print ("%s" % os.pathconf_names) # Now get maximum number of links to the file. no = os.fpathconf(fd, 'PC_LINK_MAX') print ("Maximum number of links to the file. :%d" % no) # Now get maximum length of a filename no = os.fpathconf(fd, 'PC_NAME_MAX') print ("Maximum length of a filename :%d" % no) # Close opened file os.close( fd) print ("Closed the file successfully!!")