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, unless the archive is pax (see below) |
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 2 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. star(5) says a hard link’s size is 0 in
POSIX.1-1988 archives and may be non-zero in POSIX.1-2001 ones, where data can follow:
after any x or g header in the archive the explorer obeys a
hard link’s size, as libarchive 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. star(5) says star uses it to say, through the size field, when the next
regular header will follow, and star skips the data on the volume it starts with.
Where this part starts in the whole file is given by an offset. star’s
header.c writes it into xstar_in_dbuf.t_offset, 12 bytes at
byte 464 (see the
header page), unless an extended header carries it instead, and star(5) says it is
now kept in the pax record SCHILY.offset. The explorer shows the field
when the header holds an offset at 464.
Volume labels (V)
A header of type V (GNU tar’s GNUTYPE_VOLHDR) holds a
volume label in its name; tar(5) calls it “a tape/volume header name”. star(5):
“Star uses the atime field to hold the volume number in case there is no POSIX.1-2001
extended header”, and when the size is non-zero the data that follows is skipped. 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 and AIX | Security attributes: on Solaris a run of records, each a type, a count or length and text (ACLs and Trusted Extensions labels), before the file; on AIX a binary ACL after the file, named NFS4 or AIXC, for which no published layout was found. See ACL members. star itself keeps ACLs in SCHILY.acl. records, and cannot read this type. |
E | Solaris | An extended attribute: a header member, then a member holding the attribute. star(5) names the flag and says star cannot read it. |
I | star | Inode metadata only, usually after an x header; used by incremental backups. star(5): “The size field holds the length of the file. No file data follows this header.” |
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, as a script of renames and symlinks: see old names. star does not support it. |