BSD 4_2 development
[unix-history] / usr / man / man5 / ar.5
CommitLineData
11a514e8
C
1.TH AR 5 "15 January 1983"
2.SH NAME
3ar \- archive (library) file format
4.SH SYNOPSIS
5.B #include <ar.h>
6.SH DESCRIPTION
7.PP
8The archive command
9.I ar
10combines several files into one.
11Archives are used mainly as libraries to be searched by the link-editor
12.I ld.
13.PP
14A file produced by
15.I ar
16has a magic string at the start,
17followed by the constituent files, each preceded by a file header.
18The magic number and header layout as described in the include file are:
19.RS
20.PP
21.nf
22.ta \w'#define 'u +\w'SARMAG 'u
23.ec %
24.so /usr/include/ar.h
25.ec \
26.fi
27.RE
28.LP
29The name is a blank-padded string.
30The
31.I ar_fmag
32field contains ARFMAG to help verify the presence of a header.
33The other fields are left-adjusted, blank-padded numbers.
34They are decimal except for
35.IR ar_mode ,
36which is octal.
37The date is the modification date of the file
38at the time of its insertion into the archive.
39.PP
40Each file begins on a even (0 mod 2) boundary;
41a new-line is inserted between files if necessary.
42Nevertheless the size given reflects the
43actual size of the file exclusive of padding.
44.PP
45There is no provision for empty areas in an archive file.
46.PP
47The encoding of the header is portable across machines.
48If an archive contains printable files, the archive itself is printable.
49.SH "SEE ALSO"
50ar(1), ld(1), nm(1)
51.SH BUGS
52File names lose trailing blanks.
53Most software dealing with archives takes even
54an included blank as a name terminator.