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.pathCommon pathname manipulations - 10.2.
fileinputIterate over lines from multiple input streams - 10.3.
statInterpretingstat()results - 10.4.
statvfsConstants used withos.statvfs() - 10.5.
filecmpFile and Directory Comparisons - 10.6.
tempfileGenerate temporary files and directories - 10.7.
globUnix style pathname pattern expansion - 10.8.
fnmatchUnix filename pattern matching - 10.9.
linecacheRandom access to text lines - 10.10.
shutilHigh-level file operations - 10.11.
dircacheCached directory listings - 10.12.
macpathMac OS 9 path manipulation functions
See also
- Section File Objects
A description of Pythons 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.