Contains definitions for flags used in the tar archive header.
The /usr/include/tar.h file contains extended definitions used in the typeflag and mode fields of the tar archive header block. The file also provides values for the required POSIX entries.
Every file archived using the tar command is represented by a header block describing the file, followed by zero or more blocks that give the contents of the file. The end-of-archive indicator consists of two blocks filled with binary zeros. Each block is a fixed size of 512 bytes.
Blocks are grouped for physical I/O operations and groups can be written using a single write subroutine operation. On magnetic tape, the result of this write operation is a single tape record. The last record is always a full 512 bytes. Blocks after the end-of-archive zeros contain undefined data.
The header block structure is shown in the following table. All lengths and offsets are in decimal.
Header Block Structure | |||
Field Name | Offset | Length in Bytes | Contents |
name | 0 | 100 | File name without a / (slash) |
mode | 100 | 8 | File mode |
uid | 108 | 8 | User ID |
gid | 116 | 8 | Group ID |
size | 124 | 12 | Size in bytes |
mtime | 136 | 12 | Latest modification time |
cksum | 148 | 8 | File and header checksum |
typeflag | 156 | 1 | File type |
linkname | 157 | 100 | Linked path name or file name |
magic | 257 | 6 | Format representation for tar |
version | 263 | 2 | Version representation for tar |
uname | 265 | 32 | User name |
gname | 297 | 32 | Group name |
devmajor | 329 | 8 | Major device representation |
devminor | 337 | 8 | Minor device representation |
prefix | 345 | 155 | Path name without trailing slashes |
Names are preserved only if the characters are chosen from the POSIX portable file-name character set or if the same extended character set is used between systems. During a read operation, a file can be created only if the original file can be accessed using the open, stat, chdir, fcntl, or opendir subroutine.
Each field within the header block and each character on the archive medium are contiguous. There is no padding between fields. More information about the specific fields and their values follows:
This file is part of the Base Operating System (BOS) Runtime.
The tar command.