Open System Services System Calls Reference Manual (G06.25+, H06.03+)

ar(4) OSS System Calls Reference Manual
NAME
ar - Describes the archive (library) le format
SYNOPSIS
#include <ar.h>
DESCRIPTION
The ar archive command combines several les 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 le produced by the ar command has a magic number at the start, followed by the constituent
les, each preceded by a le header. The magic number and header layout are described in the
ar.h header le.
Each le begins on an even boundary. A newline character is inserted between les if necessary;
nevertheless, the size given reects the actual size of the le exclusive of padding.
There is no provision for empty areas in an archive le.
The encoding of the header is portable across machines. If an archive contains printable les, the
archive itself is printable.
The header is made up of six xed-length ASCII elds, followed by a 2-character trailer. The
elds are as follows:
ar_name Object name (16 characters)
ar_date Files last modication time (12 characters); for example, UTC seconds since the
Epoch
ar_uid User ID (6 characters)
ar_gid Group ID (6 characters)
ar_mode Files mode (8 characters)
ar_size Files size (10 characters)
All numeric elds are in decimal, except for the le mode, which is in octal.
The 2-byte trailer is the string
`\n
Only the ar_name eld provides for overows. If any lename is more than 16 characters in
length or contains an embedded space, the string
#1/
followed by the ASCII length of the lename, is written in the ar_name eld. The le size
(stored in the archive header) is incremented by the length of the lename. The lename is then
written immediately following the archive header.
RELATED INFORMATION
Commands: ar(1), nm(1).
112 Hewlett-Packard Company 527186-003