added "more" command
[unix-history] / usr / src / usr.bin / ar / ar.5.5
CommitLineData
6592a7dc 1.\" @(#)ar.5.5 6.1 (Berkeley) %G%
6e5bb952 2.\"
6592a7dc 3.TH AR 5 ""
6e5bb952
KM
4.AT 3
5.SH NAME
6ar \- archive (library) file format
7.SH SYNOPSIS
8.B #include <ar.h>
9.SH DESCRIPTION
6e5bb952
KM
10.PP
11The archive command
12.I ar
f4258d08
KM
13combines several files into one.
14Archives are used mainly as libraries to be searched by the link-editor
6e5bb952
KM
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.
f4258d08 21The magic number and header layout as described in the include file are:
6e5bb952
KM
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
f4258d08 35field contains ARFMAG to help verify the presence of a header.
6e5bb952
KM
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
f4258d08 48There is no provision for empty areas in an archive file.
6e5bb952
KM
49.PP
50The encoding of the header is portable across machines.
f4258d08 51If an archive contains printable files, the archive itself is printable.
6e5bb952
KM
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.