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