• Home
  • Raw
  • Download

Lines Matching full:tar

1 :mod:`tarfile` --- Read and write tar archive files
5 :synopsis: Read and write tar-format archive files.
17 The :mod:`tarfile` module makes it possible to read and write tar
29 * read/write support for the GNU tar format including *longname* and *longlink*
93 not allow random access, see :ref:`tar-examples`. The currently
99 | ``'r|*'`` | Open a *stream* of tar blocks for reading |
102 | ``'r|'`` | Open a *stream* of uncompressed tar blocks |
123 Class for reading and writing tar archives. Do not use this class directly,
129 Return :const:`True` if *name* is a tar archive file, that the :mod:`tarfile`
135 Class for limited access to tar archives with a :mod:`zipfile`\ -like interface.
142 Constant for an uncompressed tar archive.
147 Constant for a :mod:`gzip` compressed tar archive.
161 Is raised when a tar archive is opened, that either cannot be handled by the
198 Each of the following constants defines a tar archive format that the
199 :mod:`tarfile` module is able to create. See section :ref:`tar-formats` for
210 GNU tar format.
232 …`GNU tar manual, Basic Tar Format <https://www.gnu.org/software/tar/manual/html_node/Standard.html…
233 Documentation for tar archive files, including GNU tar extensions.
241 The :class:`TarFile` object provides an interface to a tar archive. A tar
243 a header block followed by data blocks. It is possible to store a file in a tar
251 :ref:`tar-examples` section for a use case.
306 See section :ref:`tar-unicode` for in-depth information.
421 object will be excluded from the archive. See :ref:`tar-examples` for an
652 How to extract an entire tar archive to the current working directory::
655 tar = tarfile.open("sample.tar.gz")
656 tar.extractall()
657 tar.close()
659 How to extract a subset of a tar archive with :meth:`TarFile.extractall` using
670 tar = tarfile.open("sample.tar.gz")
671 tar.extractall(members=py_files(tar))
672 tar.close()
674 How to create an uncompressed tar archive from a list of filenames::
677 tar = tarfile.open("sample.tar", "w")
679 tar.add(name)
680 tar.close()
685 with tarfile.open("sample.tar", "w") as tar:
687 tar.add(name)
689 How to read a gzip compressed tar archive and display some member information::
692 tar = tarfile.open("sample.tar.gz", "r:gz")
693 for tarinfo in tar:
701 tar.close()
711 tar = tarfile.open("sample.tar.gz", "w:gz")
712 tar.add("foo", filter=reset)
713 tar.close()
718 Supported tar formats
721 There are three tar formats that can be created with the :mod:`tarfile` module:
728 * The GNU tar format (:const:`GNU_FORMAT`). It supports long filenames and
730 standard on GNU/Linux systems. :mod:`tarfile` fully supports the GNU tar
735 files and stores pathnames in a portable way. However, not all tar
744 There are some more variants of the tar format which can be read, but not
747 * The ancient V7 format. This is the first tar format from Unix Seventh Edition,
752 * The SunOS tar extended format. This format is a variant of the POSIX.1-2001
760 The tar format was originally conceived to make backups on tape drives with the
761 main focus on preserving file system information. Nowadays tar archives are
765 example, an ordinary tar archive created on a *UTF-8* system cannot be read