MPE/iX Shell and Utilities Reference Manual, Vol 2
cpio(2) MPE/iX Shell and Utilities cpio(2)
NAME
cpio — format of cpio archives
DESCRIPTION
This document describes the format of archives read and written by the cpio utility. A cpio
archive consists of the concatenation of one or more member files. Each member file contains
a header (as described later in this man page) optionally followed by file contents as indicated
in the header. The end of the archive is indicated by another header describing an (empty) file
named TRAILER!!.
There are two types of cpio archives, differing only in the style of the header.
ASCII archives
have totally printable header information; thus, if the files being archived are also ASCII files,
the whole archive is ASCII
. By default, cpio writes archives with binary headers.
The information in ASCII archive headers is stored in fixed-width, octal (base 8) numbers zero-
padded on the left. Table 2-1 gives the order and field width for the information in the
ASCII
header.
Field Width Field Name Meaning
6 magic magic number "070707"
6 dev device where file resides
6 ino I-number of file
6 mode file mode
6 uid owner user ID
6 gid owner group ID
6 nlink number of links to file
6 rdev device major/minor for special file
11 mtime modify time of file
6 namesize length of file name
11 filesize length of file to follow
Table 2-1: ASCII Header Format for cpio File
Most of this information is compatible with that returned by the UNIX stat() function. Af-
ter this information, namesize bytes of path name is stored. namesize includes the null byte of
the end of the path name. After this, filesize bytes of the file contents are recorded.
2-2 File Formats