diff options
author | Mark Summerfield <list@qtrac.plus.com> | 2007-11-02 08:24:59 (GMT) |
---|---|---|
committer | Mark Summerfield <list@qtrac.plus.com> | 2007-11-02 08:24:59 (GMT) |
commit | ac3d429edc5d1488c00c443d860f3e00f6bdd49e (patch) | |
tree | 124975e2f76e9c713c4482e0048a320792104692 /Doc | |
parent | f7601ee2c074092d5eee6bb077b976678c3a0433 (diff) | |
download | cpython-ac3d429edc5d1488c00c443d860f3e00f6bdd49e.zip cpython-ac3d429edc5d1488c00c443d860f3e00f6bdd49e.tar.gz cpython-ac3d429edc5d1488c00c443d860f3e00f6bdd49e.tar.bz2 |
Added more file-handling related cross-references.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/functions.rst | 5 | ||||
-rw-r--r-- | Doc/library/os.rst | 7 | ||||
-rw-r--r-- | Doc/library/shutil.rst | 3 | ||||
-rw-r--r-- | Doc/library/stdtypes.rst | 5 |
4 files changed, 15 insertions, 5 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 6c03472..1261547 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -766,8 +766,9 @@ available. They are listed here in alphabetical order. Python enforces that the mode, after stripping ``'U'``, begins with ``'r'``, ``'w'`` or ``'a'``. - See also the :mod:`fileinput` module, the :mod:`os` module, and the - :mod:`os.path` module. + Python provides many file handling modules including + :mod:`fileinput`, :mod:`os`, :mod:`os.path`, :mod:`tempfile`, and + :mod:`shutil`. .. versionchanged:: 2.5 Restriction on first letter of mode string introduced. diff --git a/Doc/library/os.rst b/Doc/library/os.rst index a776a6b..3843b53 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -11,7 +11,9 @@ functionality than importing a operating system dependent built-in module like :mod:`posix` or :mod:`nt`. If you just want to read or write a file see :func:`open`, if you want to manipulate paths, see the :mod:`os.path` module, and if you want to read all the lines in all the files on the -command line see the :mod:`fileinput` module. +command line see the :mod:`fileinput` module. For creating temporary +files and directories see the :mod:`tempfile` module, and for high-level +file and directory handling see the :mod:`shutil` module. This module searches for an operating system dependent built-in module like :mod:`mac` or :mod:`posix` and exports the same functions and data as found @@ -983,6 +985,9 @@ Files and Directories ``0777`` (octal). On some systems, *mode* is ignored. Where it is used, the current umask value is first masked out. Availability: Macintosh, Unix, Windows. + It is also possible to create temporary directories; see the + :mod:`tempfile` module's :func:`tempfile.mkdtemp` function. + .. function:: makedirs(path[, mode]) diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 8cc27d4..0f9b967 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -15,7 +15,8 @@ The :mod:`shutil` module offers a number of high-level operations on files and collections of files. In particular, functions are provided which support file -copying and removal. +copying and removal. For operations on individual files, see also the +:mod:`os` module. .. warning:: diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 2a6a973..046d494 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1846,7 +1846,10 @@ created with the built-in :func:`file` and (more usually) :func:`open` constructors described in the :ref:`built-in-funcs` section. [#]_ File objects are also returned by some other built-in functions and methods, such as :func:`os.popen` and :func:`os.fdopen` and the :meth:`makefile` -method of socket objects. +method of socket objects. Temporary files can be created using the +:mod:`tempfile` module, and high-level file operations such as copying, +moving, and deleting files and directories can be achieved with the +:mod:`shutil` module. When a file operation fails for an I/O-related reason, the exception :exc:`IOError` is raised. This includes situations where the operation is not |