format of pax archives 

File Format


This document describes the format of POSIX-defined archives read and written by the pax utility using the -xpax option.

A pax archive, in either format, consists of one or more blocks, which are used to represent member files. Each block is 512 bytes long; the -b option to pax can indicate how many of these blocks are read and/or written at once.

Each member file consists of a header block (as described later in this page) followed by 0 or more blocks containing the file contents. The end of the archive is indicated by two blocks filled with binary zeros. Unused space in the header is left as binary zeros.

The header information in a block is stored in a printable ASCII form, so that pax archives are easily ported to different environments. If the contents of the files on the archive are all ASCII, the entire archive is ASCII.

Headers have the format shown in Table 1.

Field Width Field Name Meaning

100 name name of file
8 mode file mode
8 uid owner user ID
8 gid owner group ID
12 size length of file in bytes
12 mtime modify time of file
8 chksum checksum for header
1 typeflag type of file
100 linkname name of linked file
6 magic USTAR indicator
2 version USTAR version
32 uname owner user name
32 gname owner group name
8 devmajor device major number
8 devminor device minor number
155 prefix prefix for file name

Table 1: pax Header Block

This information is compatible with that returned by the UNIX stat() function; see also stat. The magic, uname, and gname fields are null-terminated character strings. The fields name, linkname, and prefix are null-terminated unless the full field is used to store a name (that is, the last character is not null). All other fields are zero-filled octal numbers, in ASCII. Trailing nulls are present for these numbers, except for the size, mtime, and version fields.

The name field contains the name of the archived file. The value of the prefix field, if non-null, is prefixed to the name field to allow names longer then 100 characters. For compatibility with older tar commands, the PTC MKS Toolkit version of pax leaves prefix null unless the file name exceeds 100 characters.

The size field is 0 if the header describes a link.

The chksum field is a checksum of all the bytes in the header, assuming that the chksum field itself is all blanks.

The typeflag field is a compatible extension of the link field of the older TAR format. Table 2 shows the values that are recognized.

Type Flag File Type

0 or null Regular file
1 Link to another file already archived
2 Symbolic link
3 Character special device
4 Block special device
5 Directory
6 FIFO special file
7 Reserved
x Represents extended header records for the following file
A-Z Available for custom usage

Table 2: Type Flag Values for pax Format Files

In pax format, the uname and gname fields contain the name of the owner and group of the file respectively.

pax Extended Header

To overcome certain limitations in the USTAR format, the pax features an extended header that contain informatin normally not allowed in a USTAR header block. This information inclues fields which require a character encoding not described in the ISO/IEC 646: 1991 standard, fields representing file attributes not covered in the USTAR heder, and fields whose length or format do not meet the requirements of the USTAR header. Values in the extended header add attributes to the following file or override values in the following header block, as described below.

The pax extended header contains one more records in the following format:

length keyword=value

keyword can be any of the following:


is the file access time for the following file.


is the name of the character set used to encode the data in the following file.


is a comment string which is ignored by pax.


is the group name that owns the following file.


is the path name of a link to another file. This overrides the linkname field in the following header block. If the typeflag field in the following header block is 1, the link is a hard link. If typeflag is 2, it is a symbolic link.


is the file modification time of the follwing file. This overrides the mtime field in the following header block.


is the path name of the folloiwng file. This overrides the name and prefix fields in the following header block.


is the size of the file in octets. This overrides the size field in the following header block.


is the user name that owns the following file.

When the value field has a length of zero, any header block field or previous extended header record of the same name is deleted.

When a keyword in an extended header record (or in a pax -o option) overrides or deletes a corresponding field in the header block, pax ignores the contents of that header block field.


PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


cpio, pax, tar

File Formats:
cpio, tar

PTC MKS Toolkit 10.2 Documentation Build 28.