The t_typeflag byte at offset 156 of the
header says what kind of member it
describes. It is a single ASCII character. star uses the POSIX flags, the pax extended
headers, and capital letters for things POSIX has no flag for. The names in the tables
are those of the tar.h header file.
Files, links and folders
| Flag | Name | Member | Description | Data |
|---|---|---|---|---|
0 (30) | REGTYPE | Regular file | The data blocks after the header are the file’s contents. | t_size bytes |
NUL (00) | AREGTYPE | Regular file | The old form of 0. A name ending in / is a folder. | t_size bytes |
1 | LNKTYPE | Hard link | Another name for a file stored earlier in the archive; t_linkname names it. | none |
2 | SYMTYPE | Symbolic link | t_linkname holds the target. | none |
3 | CHRTYPE | Character device | t_devmajor and t_devminor give the device numbers. | none |
4 | BLKTYPE | Block device | As for a character device. | none |
5 | DIRTYPE | Directory | A folder. | none |
6 | FIFOTYPE | FIFO | A named pipe. | none |
7 | CONTTYPE | Contiguous file | Reserved by POSIX; read as 0. | t_size bytes |
For types 1 to 6, readers such as Go and libarchive skip no
data whatever t_size says. The explorer does the same, and follows the size
only when the block after the header is not a header and the block after the data
would be, reporting it when it does.
Extended headers
exustar archives always have pax headers, and other star archives may have them too. See pax extensions.
| Flag | Name | Header | Description |
|---|---|---|---|
x | XHDTYPE | Extended header | Records that apply to the next member only. |
g | XGLTYPE | Global extended header | Records that apply to every following member, until changed by another g header. |
X | SOLARIS_XHDTYPE | Solaris extended header | Sun’s form of x; libarchive and the explorer read it like x. |
Multi-volume continuations (M)
In a multi-volume archive, a file that does not fit on one volume continues on the next
in a header of type M, holding the rest of the file. The flag is GNU tar’s
(GNUTYPE_MULTIVOL), and the explorer reads it the same way in a star
archive. Where this part starts in the whole file is given by an offset: in star’s
sparse header layout it is
the offset field at byte 464, and star(5) says it is now kept in the pax
record SCHILY.offset.
Volume labels (V)
A header of type V (GNU tar’s GNUTYPE_VOLHDR) holds a
volume label in its name, and no data in practice; tar(5) calls it “a tape/volume
header name”. star also describes volumes in global pax records, the
SCHILY.volhdr. keys; see
vendor keys.
Vendor flags
POSIX reserves the capital letters A to Z for custom
implementations. A reader that meets a flag it does not know treats the member as a
regular file; the explorer does the same, and shows the flag as an unknown type. These
are the vendor flags a reader may meet in a star archive:
| Flag | From | Meaning |
|---|---|---|
A | Solaris | An access control list. tar(5): the data is a seven-digit octal number and a NUL, then the ACL; 01000000 is POSIX.1e, 03000000 NFSv4. star itself keeps ACLs in SCHILY.acl. records. |
E | Solaris | An extended attribute file (named in star(5)). |
I | star | Inode metadata only, with no data, usually after an x header; used by incremental backups. |
S | star and GNU tar | A sparse file. In a star archive it has star’s sparse header, not GNU tar’s. |
D | GNU tar | A dump directory. |
K | GNU tar | Its data is the long link target of the next member. |
L | GNU tar | Its data is the long name of the next member. |
N | GNU tar | Old long names; tar(5): “no longer generated”. |