Next: Sparse Formats, Previous: Standard, Up: Tar Internals [Contents][Index]

### GNU Extensions to the Archive Format

> (This message will disappear, once this node revised.)

The GNU format uses additional file types to describe new types of files in an archive. These are listed below.

`GNUTYPE_DUMPDIR`
`'D'`

  This represents a directory and a list of files created by the `--incremental` (`-G`) option. The `size` field gives the total size of the associated list of files. Each file name is preceded by either a ‘`Y`’ (the file should be in this archive) or an ‘`N`’. (The file is a directory, or is not stored in the archive.) Each file name is terminated by a null. There is an additional null after the last file name.

`GNUTYPE_MULTIVOL`
`'M'`

  This represents a file continued from another volume of a multi-volume archive created with the `--multi-volume` (`-M`) option. The original type of the file is not given here. The `size` field gives the maximum size of this piece of the file (assuming the volume does not end before the file is written out). The `offset` field gives the offset from the beginning of the file where this part of the file begins. Thus `size` plus `offset` should equal the original size of the file.

`GNUTYPE_SPARSE`
`'S'`

  This flag indicates that we are dealing with a sparse file. Note that archiving a sparse file requires special operations to find holes in the file, which mark the positions of these holes, along with the number of bytes of data to be found after the hole.

`GNUTYPE_VOLHDR`
`'V'`

  This file type is used to mark the volume header that was given with the `--label=archive-label` (`-V archive-label`) option when the archive was created. The `name` field contains the `name` given after the `--label=archive-label` (`-V archive-label`) option. The `size` field is zero. Only the first file in each volume of an archive should have this type.

For fields containing numbers or timestamps that are out of range for the basic format, the GNU format uses a base-256 representation instead of an ASCII octal number. If the leading byte is 0xff (255), all the bytes of the field (including the leading byte) are concatenated in big-endian order, with the result being a negative number expressed in two’s complement form. If the leading byte is 0x80 (128), the non-leading bytes of the field are concatenated in big-endian order, with the result being a positive number expressed in binary form. Leading bytes other than 0xff, 0x80 and ASCII octal digits are reserved for future use, as are base-256 representations of values that would be in range for the basic format.

You may have trouble reading a GNU format archive on a non-GNU system if the options `--incremental` (`-G`), `--multi-volume` (`-M`), `--sparse` (`-S`), or `--label=archive-label` (`-V archive-label`) were used when writing the archive. In general, if `tar` does not use the GNU-added fields of the header, other versions of `tar` should be able to read the archive. Otherwise, the `tar` program will give an error, the most likely one being a checksum error.

Next: Sparse Formats, Previous: Standard, Up: Tar Internals [Contents][Index]