[Python-checkins] r58765 - python/trunk/Doc/library/functions.rst python/trunk/Doc/library/os.rst python/trunk/Doc/library/shutil.rst python/trunk/Doc/library/stdtypes.rst
mark.summerfield
python-checkins at python.org
Fri Nov 2 09:24:59 CET 2007
Author: mark.summerfield
Date: Fri Nov 2 09:24:59 2007
New Revision: 58765
Modified:
python/trunk/Doc/library/functions.rst
python/trunk/Doc/library/os.rst
python/trunk/Doc/library/shutil.rst
python/trunk/Doc/library/stdtypes.rst
Log:
Added more file-handling related cross-references.
Modified: python/trunk/Doc/library/functions.rst
==============================================================================
--- python/trunk/Doc/library/functions.rst (original)
+++ python/trunk/Doc/library/functions.rst Fri Nov 2 09:24:59 2007
@@ -766,8 +766,9 @@
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.
Modified: python/trunk/Doc/library/os.rst
==============================================================================
--- python/trunk/Doc/library/os.rst (original)
+++ python/trunk/Doc/library/os.rst Fri Nov 2 09:24:59 2007
@@ -11,7 +11,9 @@
: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 @@
``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])
Modified: python/trunk/Doc/library/shutil.rst
==============================================================================
--- python/trunk/Doc/library/shutil.rst (original)
+++ python/trunk/Doc/library/shutil.rst Fri Nov 2 09:24:59 2007
@@ -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::
Modified: python/trunk/Doc/library/stdtypes.rst
==============================================================================
--- python/trunk/Doc/library/stdtypes.rst (original)
+++ python/trunk/Doc/library/stdtypes.rst Fri Nov 2 09:24:59 2007
@@ -1846,7 +1846,10 @@
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
More information about the Python-checkins
mailing list