diff --git a/Doc/library/archiving.rst b/Doc/library/archiving.rst --- a/Doc/library/archiving.rst +++ b/Doc/library/archiving.rst @@ -6,7 +6,8 @@ Data Compression and Archiving The modules described in this chapter support data compression with the zlib, gzip, bzip2 and lzma algorithms, and the creation of ZIP- and tar-format -archives. +archives. See also :ref:`archiving-operations` provided by the :mod:`shutil` +module. .. toctree:: diff --git a/Doc/library/bz2.rst b/Doc/library/bz2.rst --- a/Doc/library/bz2.rst +++ b/Doc/library/bz2.rst @@ -12,9 +12,6 @@ This module provides a comprehensive interface for compressing and decompressing data using the bzip2 compression algorithm. -For related file formats, see the :mod:`gzip`, :mod:`lzma`, :mod:`zipfile`, and -:mod:`tarfile` modules. - The :mod:`bz2` module contains: * The :class:`BZ2File` class for reading and writing compressed files. diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst --- a/Doc/library/gzip.rst +++ b/Doc/library/gzip.rst @@ -21,9 +21,6 @@ Note that additional file formats which :program:`gzip` and :program:`gunzip` programs, such as those produced by :program:`compress` and :program:`pack`, are not supported by this module. -For related file formats, see the :mod:`bz2`, :mod:`lzma`, :mod:`zipfile`, and -:mod:`tarfile` modules. - The module defines the following items: diff --git a/Doc/library/lzma.rst b/Doc/library/lzma.rst --- a/Doc/library/lzma.rst +++ b/Doc/library/lzma.rst @@ -14,9 +14,6 @@ decompressing data using the LZMA compre interface supporting the ``.xz`` and legacy ``.lzma`` file formats used by the :program:`xz` utility, as well as raw compressed streams. -For related file formats, see the :mod:`bz2`, :mod:`gzip`, :mod:`zipfile`, and -:mod:`tarfile` modules. - The interface provided by this module is very similar to that of the :mod:`bz2` module. However, note that :class:`LZMAFile` is *not* thread-safe, unlike :class:`bz2.BZ2File`, so if you need to use a single :class:`LZMAFile` instance diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -31,6 +31,8 @@ copying and removal. For operations on i are not copied. +.. _file-operations: + Directory and files operations ------------------------------ @@ -207,7 +209,7 @@ Directory and files operations (*srcname*, *dstname*, *exception*). -.. _shutil-example: +.. _shutil-copytree-example: copytree example :::::::::::::::: @@ -274,6 +276,9 @@ Another example that uses the *ignore* a Archiving operations -------------------- +High-level utilities to create and read compressed and archived files are also +provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules. + .. function:: make_archive(base_name, format, [root_dir, [base_dir, [verbose, [dry_run, [owner, [group, [logger]]]]]]]) Create an archive file (such as zip or tar) and return its name. @@ -401,6 +406,7 @@ Archiving operations .. versionadded:: 3.2 +.. _shutil-archiving-example: Archiving example ::::::::::::::::: @@ -426,5 +432,3 @@ The resulting archive contains:: -rw------- tarek/staff 1675 2008-06-09 13:26:54 ./id_rsa -rw-r--r-- tarek/staff 397 2008-06-09 13:26:54 ./id_rsa.pub -rw-r--r-- tarek/staff 37192 2010-02-06 18:23:10 ./known_hosts - - diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst --- a/Doc/library/tarfile.rst +++ b/Doc/library/tarfile.rst @@ -14,7 +14,8 @@ The :mod:`tarfile` module makes it possible to read and write tar archives, including those using gzip or bz2 compression. -(:file:`.zip` files can be read and written using the :mod:`zipfile` module.) +Use the :mod:`zipfile` module to read or write :file:`.zip` files, or the +higher-level functions in :ref:`shutil `. Some facts and figures: diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -23,9 +23,6 @@ decryption of encrypted files in ZIP arc create an encrypted file. Decryption is extremely slow as it is implemented in native Python rather than C. -For related file formats, see the :mod:`bz2`, :mod:`gzip`, :mod:`lzma`, and -:mod:`tarfile` modules. - The module defines the following items: .. exception:: BadZipFile diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst --- a/Doc/library/zlib.rst +++ b/Doc/library/zlib.rst @@ -18,9 +18,7 @@ order. This documentation doesn't attem consult the zlib manual at http://www.zlib.net/manual.html for authoritative information. -For reading and writing ``.gz`` files see the :mod:`gzip` module. For other -related file formats, see the :mod:`bz2`, :mod:`lzma`, :mod:`zipfile`, and -:mod:`tarfile` modules. +For reading and writing ``.gz`` files see the :mod:`gzip` module. The available exception and functions in this module are: