TAR(5,F) AIX Technical Reference TAR(5,F)
-------------------------------------------------------------------------------
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 precedes 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 typeflag;
char linkname[100];
char magic[6];
char version[2];
char uname[32];
char gname[32];
char devmajor[8];
char devminor[8];
char prefix[155];
};
All fields, except typeflag, 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.
typeflag
Contains '0' or '\0' for a regular file.
Contains '1' if this file is a link to a previous file on the file
on the tape.
Contains '2' for a symbolic link.
Processed November 7, 1990 TAR(5,F) 1
TAR(5,F) AIX Technical Reference TAR(5,F)
Contains '3' for a character special file.
Contains '4' for a block special file.
Contains '5' for a directory.
Contains '6' for a FIFO special file.
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 and device site number for special files
(the device site number is used by TCF).
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.
magic Contains the string TMAGIC ("ustar") indicating that this archive has
been written in the POSIX-extended tar format.
version Contains the string TVERSION ("00").
uname Contains the ASCII representation of the owner of the file.
gname Contains the ASCII representation of the group of the file.
devmajor Contains the device major number for character and block special
files.
devminor Contains the device minor number for character and block special
files.
prefix Contains the path prefix of the archive file.
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). Also, if the directory is a hidden directory, an @ (at) is appended
to the name prior to the / (slash). A special file is also written with 0
size. Its major/minor device number and device site number are in the mtime
field.
FILE
Processed November 7, 1990 TAR(5,F) 2
TAR(5,F) AIX Technical Reference TAR(5,F)
/usr/include/tar.h
RELATED INFORMATION
The tar command in AIX Operating System Commands Reference.
Processed November 7, 1990 TAR(5,F) 3