4.3BSD-Reno/share/man/cat5/ar.0
AR(5) 1985 AR(5)
NNAAMMEE
ar - archive (library) file format
SSYYNNOOPPSSIISS
##iinncclluuddee <<aarr..hh>>
DDEESSCCRRIIPPTTIIOONN
The archive command _a_r combines several files into one.
Archives are used mainly as libraries to be searched by the
link-editor _l_d.
A file produced by _a_r has a magic string at the start, fol-
lowed by the constituent files, each preceded by a file
header. The magic number and header layout as described in
the include file are:
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* @(#)ar.h5.1 (Berkeley) 5/30/85
*/
#define ARMAG "!<arch>\n"
#define SARMAG 8
#define ARFMAG "`\n"
struct ar_hdr {
char ar_name[16];
char ar_date[12];
char ar_uid[6];
char ar_gid[6];
char ar_mode[8];
char ar_size[10];
char ar_fmag[2];
};
The name is a blank-padded string. The _a_r__f_m_a_g field con-
tains ARFMAG to help verify the presence of a header. The
other fields are left-adjusted, blank-padded numbers. They
are decimal except for _a_r__m_o_d_e, which is octal. The date is
the modification date of the file at the time of its inser-
tion into the archive.
Each file begins on a even (0 mod 2) boundary; a new-line is
inserted between files if necessary. Nevertheless the size
given reflects the actual size of the file exclusive of pad-
ding.
Printed 7/27/90 May 1
AR(5) 1985 AR(5)
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.
SSEEEE AALLSSOO
ar(1), ld(1), nm(1)
BBUUGGSS
File names lose trailing blanks. Most software dealing with
archives takes even an included blank as a name terminator.
Printed 7/27/90 May 2