diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-15 11:11:28 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-15 11:11:28 (GMT) |
commit | 11cb961b38550443d287b2b55174e504c2309af2 (patch) | |
tree | 51b2972800e593dde1b5f5154b9b044058a350d7 /Doc/library/tarfile.rst | |
parent | 6a11a98b7c8f576d7663182cbd09123eb108a928 (diff) | |
download | cpython-11cb961b38550443d287b2b55174e504c2309af2.zip cpython-11cb961b38550443d287b2b55174e504c2309af2.tar.gz cpython-11cb961b38550443d287b2b55174e504c2309af2.tar.bz2 |
Add cross-references to the glossary entry for file objects.
Diffstat (limited to 'Doc/library/tarfile.rst')
-rw-r--r-- | Doc/library/tarfile.rst | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst index b1d7361..853406c 100644 --- a/Doc/library/tarfile.rst +++ b/Doc/library/tarfile.rst @@ -66,8 +66,8 @@ Some facts and figures: *mode* ``'r'`` to avoid this. If a compression method is not supported, :exc:`CompressionError` is raised. - If *fileobj* is specified, it is used as an alternative to a file object opened - for *name*. It is supposed to be at position 0. + If *fileobj* is specified, it is used as an alternative to a :term:`file object` + opened in binary mode for *name*. It is supposed to be at position 0. For special purposes, there is a second format for *mode*: ``'filemode|[compression]'``. :func:`tarfile.open` will return a :class:`TarFile` @@ -75,7 +75,7 @@ Some facts and figures: be done on the file. If given, *fileobj* may be any object that has a :meth:`read` or :meth:`write` method (depending on the *mode*). *bufsize* specifies the blocksize and defaults to ``20 * 512`` bytes. Use this variant - in combination with e.g. ``sys.stdin``, a socket file object or a tape + in combination with e.g. ``sys.stdin``, a socket :term:`file object` or a tape device. However, such a :class:`TarFile` object is limited in that it does not allow to be accessed randomly, see :ref:`tar-examples`. The currently possible modes: @@ -355,9 +355,9 @@ be finalized; only the internally used file object will be closed. See the .. method:: TarFile.extractfile(member) Extract a member from the archive as a file object. *member* may be a filename - or a :class:`TarInfo` object. If *member* is a regular file, a file-like object - is returned. If *member* is a link, a file-like object is constructed from the - link's target. If *member* is none of the above, :const:`None` is returned. + or a :class:`TarInfo` object. If *member* is a regular file, a :term:`file-like + object` is returned. If *member* is a link, a file-like object is constructed from + the link's target. If *member* is none of the above, :const:`None` is returned. .. note:: @@ -402,9 +402,9 @@ be finalized; only the internally used file object will be closed. See the .. method:: TarFile.gettarinfo(name=None, arcname=None, fileobj=None) - Create a :class:`TarInfo` object for either the file *name* or the file object - *fileobj* (using :func:`os.fstat` on its file descriptor). You can modify some - of the :class:`TarInfo`'s attributes before you add it using :meth:`addfile`. + Create a :class:`TarInfo` object for either the file *name* or the :term:`file + object` *fileobj* (using :func:`os.fstat` on its file descriptor). You can modify + some of the :class:`TarInfo`'s attributes before you add it using :meth:`addfile`. If given, *arcname* specifies an alternative name for the file in the archive. |