tar
Purpose
Describes the tape archive format.
Description
The tar command reads and writes tapes in tape archive
format. A tar tape consists of several 512-byte logical
blocks that can be grouped (on magnetic tape) into
records, which are some constant multiple of 512-byte
blocks long. Block in the following description means
logical block.
The following is the format of a file header that pre-
cedes each disk file written on the tape:
struct {
char name[100];
char mode[8];
char uid[8];
char gid[8];
char size[12];
char mtime[12];
char chksum[8];
char linkflag;
char linkname[100];
};
All fields, except linkflag, are ASCII null-terminated
strings. Numeric fields can contain leading blanks. The
fields have the following meanings:
chksum Contains a byte-by-byte sum of the entire
header block assuming that the chksum field is
all blanks.
gid Contains the group identification of the file,
in octal.
linkflag Contains a 1 if this file is a link to a pre-
vious file on the the tape, otherwise null.
linkname Contains the name of a file if linkflag has a
value of 1. The file named in this field is
linked to the name file.
mode Contains the mode of the file, which includes
the protection bits, setuid bits, setgid bits,
and file type, in octal.
mtime Contains the modification time, in octal.
This field gives the major/minor device number
for special files.
name Contains the name of the file.
size Contains the size in bytes, in octal. This
field is 0 for special files.
uid Contains the user identification of the file,
in octal.
Unused bytes are null. Following the file header block
are the data blocks of the file. The last block is null-
padded if necessary. Two null blocks designate the end
of the tape.
Directories and special files are treated in a slightly
different way. A directory size is 0, meaning no data
blocks follow, and its name ends with a / (slash). A
special file is also written with 0 size. Its
major/minor device number is in the mtime field.
Related Information
The tar command in AIX Operating System Commands Refer-
ence.