Open System Services System Calls Reference Manual (G06.25+, H06.03+)
ar(4) OSS System Calls Reference Manual
NAME
ar - Describes the archive (library) file format
SYNOPSIS
#include <ar.h>
DESCRIPTION
The ar archive command combines several files into one. Archives are used mainly as libraries
to be searched by the Binder utility for TNS or accelerated programs and by the nld utility for
TSN/R native programs.
A file produced by the ar command has a magic number at the start, followed by the constituent
files, each preceded by a file header. The magic number and header layout are described in the
ar.h header file.
Each file begins on an even boundary. A newline character is inserted between files if necessary;
nevertheless, the size given reflects the actual size of the file exclusive of padding.
There is no provision for empty areas in an archive file.
The encoding of the header is portable across machines. If an archive contains printable files, the
archive itself is printable.
The header is made up of six fixed-length ASCII fields, followed by a 2-character trailer. The
fields are as follows:
ar_name Object name (16 characters)
ar_date File’s last modification time (12 characters); for example, UTC seconds since the
Epoch
ar_uid User ID (6 characters)
ar_gid Group ID (6 characters)
ar_mode File’s mode (8 characters)
ar_size File’s size (10 characters)
All numeric fields are in decimal, except for the file mode, which is in octal.
The 2-byte trailer is the string
`\n
Only the ar_name field provides for overflows. If any filename is more than 16 characters in
length or contains an embedded space, the string
#1/
followed by the ASCII length of the filename, is written in the ar_name field. The file size
(stored in the archive header) is incremented by the length of the filename. The filename is then
written immediately following the archive header.
RELATED INFORMATION
Commands: ar(1), nm(1).
11−2 Hewlett-Packard Company 527186-003