pax interchange format

Description

A pax archive tape or file that is produced in the -x pax format shall contain a series of blocks. The physical layout of the archive shall be identical to the USTAR format described in tar - Format of tar archives. Each file archived shall be represented by the following sequence:

  • An optional header block with extended header records. This header block is of the form that is described in pax header block, with a typeflag value of x or g. The extended header records, described in pax extended header, shall be included as the data for this header block.
  • A header block that describes the file. Any fields in the preceding optional extended header shall override the associated fields in this header block for this file.
  • Zero or more blocks that contain the contents of the file.
At the end of the archive file, there shall be two 512-byte blocks filled with binary zeros, interpreted as an end-of-archive indicator.
A schematic of an example archive with global extended header records and two actual files is shown in the following list. In the list, the second file in the archive has no extended header preceding it, presumably because it does not need extended attributes.
Table 1. Schematic of an archive
Header block File
USTAR Header [typeflag=g] Global Extended Header.
Global Extended Header Data Global Extended Header.
USTAR Header [typeflag=x] File 1: Extended Header is included.
Extended Header Data File 1: Extended Header is included.
USTAR Header [typeflag=0] File 1: Extended Header is included.
Data for File 1 File 1: Extended Header is included.
USTAR Header [typeflag=0] File 2: No Extended Header is included.
Data for File 2 File 2: No Extended Header is included.
Block of binary zeros End of Archive Indicator.