Python Library Reference
Previous: Up: Python Library Reference Next:


11. 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:

os.path Common pathname manipulations.
fileinput Perl-like iteration over lines from multiple input streams, with ``save in place'' capability.
stat Utilities for interpreting the results of os.stat(), os.lstat() and os.fstat().
statvfs Constants for interpreting the result of os.statvfs().
filecmp Compare files efficiently.
tempfile Generate temporary files and directories.
glob Unix shell style pathname pattern expansion.
fnmatch Unix shell style filename pattern matching.
linecache This module provides random access to individual lines from text files.
shutil High-level file operations, including copying.
dircache Return directory listing, with cache mechanism.

Also see section 3.9 for a description of Python's built-in file objects.

See Also:

Module os :
Operating system interfaces, including functions to work with files at a lower level than the built-in file object.

Python Library Reference
Previous: Up: Python Library Reference Next:

Release 2.5, documentation updated on 19th September, 2006.
See About this document... for information on suggesting changes.

AltStyle によって変換されたページ (->オリジナル) /