February 2006
Intermediate to advanced
648 pages
14h 53m
English
The tarfile module is used to manipulate tar archive files. Using this module, it is possible to read and write tar files, with or without compression.
is_tarfile(name)
Returns True if name appears to be a valid tar file that can be read by this module.
open([name [, mode [, fileobj [, bufsize]]]])
Creates a new TarFile object with the pathname name. mode is a string that specifies how the tar file is to be opened. The mode string is a combination of a file mode and a compression scheme specified as 'filemode[:compression]'. Valid combinations include the following:
| Mode | Description |
|---|---|
| 'r' | Open for reading. If the file is compressed, it is decompressed transparently. This is the default mode. |
| 'r:' | Open for reading without compression. |
| 'r:gz' ... |
Read now
Unlock full access