BSD 3 development
[unix-history] / usr / man / man5 / ar.5
CommitLineData
e6817382
BJ
1.TH AR 5
2.SH NAME
3ar \- archive (library) file format
4.SH SYNOPSIS
5.B #include <ar.h>
6.SH DESCRIPTION
7The archive command
8.I ar
9is used to combine several files into
10one.
11Archives are used mainly as libraries to be searched
12by the link-editor
13.I ld.
14.PP
15A file produced by
16.I ar
17has a magic number at the start,
18followed by the constituent files, each preceded by a file header.
19The magic number and header layout as described in the
20include file are:
21.RS
22.PP
23.nf
24.ta \w'#define 'u +\w'ARMAG 'u
25.so /usr/include/ar.h
26.fi
27.RE
28.LP
29The name is a null-terminated string; the date is in the
30form of
31.IR time (2);
32the user ID and group ID are numbers; the mode is a bit pattern
33per
34.IR chmod (2);
35the size is counted in bytes.
36.PP
37Each file begins on a word boundary;
38a null byte is inserted between files if necessary.
39Nevertheless the size given reflects the
40actual size of the file exclusive of padding.
41.PP
42Notice there is no provision for empty areas in an archive
43file.
44.SH "SEE ALSO"
45ar(1), ld(1), nm(1)
46.SH BUGS
47Coding user and group IDs as characters is a botch.