Lines Matching full:tar

1 :mod:`tarfile` --- Read and write tar archive files
5 :synopsis: Read and write tar-format archive files.
14 The :mod:`tarfile` module makes it possible to read and write tar
26 * read/write support for the GNU tar format including *longname* and *longlink*
113 not allow random access, see :ref:`tar-examples`. The currently
119 | ``'r|*'`` | Open a *stream* of tar blocks for reading |
122 | ``'r|'`` | Open a *stream* of uncompressed tar blocks |
155 Class for reading and writing tar archives. Do not use this class directly:
161 Return :const:`True` if *name* is a tar archive file, that the :mod:`tarfile`
175 Is raised when a tar archive is opened, that either cannot be handled by the
210 Each of the following constants defines a tar archive format that the
211 :mod:`tarfile` module is able to create. See section :ref:`tar-formats` for
222 GNU tar format.
244 …`GNU tar manual, Basic Tar Format <https://www.gnu.org/software/tar/manual/html_node/Standard.html…
245 Documentation for tar archive files, including GNU tar extensions.
253 The :class:`TarFile` object provides an interface to a tar archive. A tar
255 a header block followed by data blocks. It is possible to store a file in a tar
263 :ref:`tar-examples` section for a use case.
316 See section :ref:`tar-unicode` for in-depth information.
459 archive. See :ref:`tar-examples` for an example.
672 with tar archives.
674 If you want to create a new tar archive, specify its name after the :option:`-c`
679 $ python -m tarfile -c monty.tar spam.txt eggs.txt
685 $ python -m tarfile -c monty.tar life-of-brian_1979/
687 If you want to extract a tar archive into the current directory, use
692 $ python -m tarfile -e monty.tar
694 You can also extract a tar archive into a different directory by passing the
699 $ python -m tarfile -e monty.tar other-dir/
701 For a list of the files in a tar archive, use the :option:`-l` option:
705 $ python -m tarfile -l monty.tar
740 How to extract an entire tar archive to the current working directory::
743 tar = tarfile.open("sample.tar.gz")
744 tar.extractall()
745 tar.close()
747 How to extract a subset of a tar archive with :meth:`TarFile.extractall` using
758 tar = tarfile.open("sample.tar.gz")
759 tar.extractall(members=py_files(tar))
760 tar.close()
762 How to create an uncompressed tar archive from a list of filenames::
765 tar = tarfile.open("sample.tar", "w")
767 tar.add(name)
768 tar.close()
773 with tarfile.open("sample.tar", "w") as tar:
775 tar.add(name)
777 How to read a gzip compressed tar archive and display some member information::
780 tar = tarfile.open("sample.tar.gz", "r:gz")
781 for tarinfo in tar:
789 tar.close()
799 tar = tarfile.open("sample.tar.gz", "w:gz")
800 tar.add("foo", filter=reset)
801 tar.close()
806 Supported tar formats
809 There are three tar formats that can be created with the :mod:`tarfile` module:
816 * The GNU tar format (:const:`GNU_FORMAT`). It supports long filenames and
818 standard on GNU/Linux systems. :mod:`tarfile` fully supports the GNU tar
823 files and stores pathnames in a portable way. However, not all tar
832 There are some more variants of the tar format which can be read, but not
835 * The ancient V7 format. This is the first tar format from Unix Seventh Edition,
840 * The SunOS tar extended format. This format is a variant of the POSIX.1-2001
848 The tar format was originally conceived to make backups on tape drives with the
849 main focus on preserving file system information. Nowadays tar archives are
853 example, an ordinary tar archive created on a *UTF-8* system cannot be read