10. File and Directory AccessΒΆ
The modules described in this chapter deal with disk files and directories. For example, there are modules for reading the properties of files, manipulating paths in a portable way, and creating temporary files. The full list of modules in this chapter is:
- 10.1.
os.pathβ Common pathname manipulations - 10.2.
fileinputβ Iterate over lines from multiple input streams - 10.3.
statβ Interpretingstat()results - 10.4.
statvfsβ Constants used withos.statvfs() - 10.5.
filecmpβ File and Directory Comparisons - 10.6.
tempfileβ Generate temporary files and directories - 10.7.
globβ Unix style pathname pattern expansion - 10.8.
fnmatchβ Unix filename pattern matching - 10.9.
linecacheβ Random access to text lines - 10.10.
shutilβ High-level file operations - 10.11.
dircacheβ Cached directory listings - 10.12.
macpathβ Mac OS 9 path manipulation functions
See also
- Section File Objects
A description of Pythonβs built-in file objects.
- Module
os Operating system interfaces, including functions to work with files at a lower level than the built-in file object.
