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*
116 not allow random access, see :ref:`tar-examples`. The currently
122 | ``'r|*'`` | Open a *stream* of tar blocks for reading |
125 | ``'r|'`` | Open a *stream* of uncompressed tar blocks |
159 Class for reading and writing tar archives. Do not use this class directly:
165 Return :const:`True` if *name* is a tar archive file, that the :mod:`tarfile`
182 Is raised when a tar archive is opened, that either cannot be handled by the
249 Each of the following constants defines a tar archive format that the
250 :mod:`tarfile` module is able to create. See section :ref:`tar-formats` for
261 GNU tar format.
287 …`GNU tar manual, Basic Tar Format <https://www.gnu.org/software/tar/manual/html_node/Standard.html…
288 Documentation for tar archive files, including GNU tar extensions.
296 The :class:`TarFile` object provides an interface to a tar archive. A tar
298 a header block followed by data blocks. It is possible to store a file in a tar
306 :ref:`tar-examples` section for a use case.
357 See section :ref:`tar-unicode` for in-depth information.
436 It is recommended to set this explicitly depending on which *tar* features
569 archive. See :ref:`tar-examples` for an example.
856 The *tar* format is designed to capture all details of a UNIX-like filesystem,
858 Unfortunately, the features make it easy to create tar files that have
860 For example, extracting a tar file can overwrite arbitrary files in various
881 * the string ``'tar'``: Honor most *tar*-specific features (i.e. features of
932 Implements the ``'tar'`` filter.
1019 * Tar files may contain multiple versions of the same file.
1079 tar.extractall(path, filter=filter_func)
1108 with tar archives.
1110 If you want to create a new tar archive, specify its name after the :option:`-c`
1115 $ python -m tarfile -c monty.tar spam.txt eggs.txt
1121 $ python -m tarfile -c monty.tar life-of-brian_1979/
1123 If you want to extract a tar archive into the current directory, use
1128 $ python -m tarfile -e monty.tar
1130 You can also extract a tar archive into a different directory by passing the
1135 $ python -m tarfile -e monty.tar other-dir/
1137 For a list of the files in a tar archive, use the :option:`-l` option:
1141 $ python -m tarfile -l monty.tar
1175 Only string names are accepted (that is, ``fully_trusted``, ``tar``,
1185 How to extract an entire tar archive to the current working directory::
1188 tar = tarfile.open("sample.tar.gz")
1189 tar.extractall()
1190 tar.close()
1192 How to extract a subset of a tar archive with :meth:`TarFile.extractall` using
1203 tar = tarfile.open("sample.tar.gz")
1204 tar.extractall(members=py_files(tar))
1205 tar.close()
1207 How to create an uncompressed tar archive from a list of filenames::
1210 tar = tarfile.open("sample.tar", "w")
1212 tar.add(name)
1213 tar.close()
1218 with tarfile.open("sample.tar", "w") as tar:
1220 tar.add(name)
1222 How to read a gzip compressed tar archive and display some member information::
1225 tar = tarfile.open("sample.tar.gz", "r:gz")
1226 for tarinfo in tar:
1234 tar.close()
1244 tar = tarfile.open("sample.tar.gz", "w:gz")
1245 tar.add("foo", filter=reset)
1246 tar.close()
1251 Supported tar formats
1254 There are three tar formats that can be created with the :mod:`tarfile` module:
1261 * The GNU tar format (:const:`GNU_FORMAT`). It supports long filenames and
1263 standard on GNU/Linux systems. :mod:`tarfile` fully supports the GNU tar
1268 files and stores pathnames in a portable way. Modern tar implementations,
1269 including GNU tar, bsdtar/libarchive and star, fully support extended *pax*
1280 There are some more variants of the tar format which can be read, but not
1283 * The ancient V7 format. This is the first tar format from Unix Seventh Edition,
1288 * The SunOS tar extended format. This format is a variant of the POSIX.1-2001
1296 The tar format was originally conceived to make backups on tape drives with the
1297 main focus on preserving file system information. Nowadays tar archives are
1301 example, an ordinary tar archive created on a *UTF-8* system cannot be read