Tcl Library Source Code

Documentation
Login


[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]

NAME

tar - Tar file creation, extraction & manipulation

Table Of Contents

SYNOPSIS

package require Tcl 8.5 9
package require tar ?0.13?

::tar::contents tarball ?-chan? ?-gzip?
::tar::stat tarball ?file? ?-chan? ?-gzip?
::tar::untar tarball args
::tar::get tarball fileName ?-chan? ?-gzip?
::tar::create tarball files args
::tar::add tarball files args
::tar::remove tarball files

DESCRIPTION

Note: Starting with version 0.8 the tar reader commands (contents, stats, get, untar) support the GNU LongName extension (header type 'L') for large paths.

BEWARE

For all commands, when using -chan ...

  1. It is assumed that the channel was opened for reading, and configured for binary input.

  2. It is assumed that the channel position is at the beginning of a legal tar file.

  3. The commands will modify the channel position as they perform their task.

  4. The commands will not close the channel.

  5. In other words, the commands leave the channel in a state very likely unsuitable for use by further tar commands. Still doing so will very likely results in errors, bad data, etc. pp.

  6. It is the responsibility of the user to seek the channel back to a suitable position.

  7. When using a channel transformation which is not generally seekable, for example gunzip, then it is the responsibility of the user to (a) unstack the transformation before seeking the channel back to a suitable position, and (b) for restacking it after.

Regarding support for gzip compression:

  1. Errors are thrown when attempting to read from compressed tar archives while compression support (i.e. ::zlib) is not available.

  2. Errors are thrown when attempting to read an uncompressed tar archive when compression is requested by the user (-gzip).

    No errors are thrown when attempting to read a compressed tar archive when compression was not requested, and is supported. In that case the commands automatically activate the code handling the compression.

  3. Errors are thrown when attempting to edit compressed tar archives. See the commands tar::add, and tar::remove. This is not supported.

  4. Creation of compressed tar archives however is supported, as this sequentially writes the archive, allowing for streaming compression.

COMMANDS

Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category tar of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.

When proposing code changes, please provide unified diffs, i.e the output of diff -u.

Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar.

KEYWORDS

archive, tape archive, tar

CATEGORY

File formats