Commit | Line | Data |
---|---|---|
6592a7dc | 1 | .\" @(#)ar.5.5 6.1 (Berkeley) %G% |
6e5bb952 | 2 | .\" |
6592a7dc | 3 | .TH AR 5 "" |
6e5bb952 KM |
4 | .AT 3 |
5 | .SH NAME | |
6 | ar \- archive (library) file format | |
7 | .SH SYNOPSIS | |
8 | .B #include <ar.h> | |
9 | .SH DESCRIPTION | |
6e5bb952 KM |
10 | .PP |
11 | The archive command | |
12 | .I ar | |
f4258d08 KM |
13 | combines several files into one. |
14 | Archives are used mainly as libraries to be searched by the link-editor | |
6e5bb952 KM |
15 | .I ld. |
16 | .PP | |
17 | A file produced by | |
18 | .I ar | |
19 | has a magic string at the start, | |
20 | followed by the constituent files, each preceded by a file header. | |
f4258d08 | 21 | The 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 | |
32 | The name is a blank-padded string. | |
33 | The | |
34 | .I ar_fmag | |
f4258d08 | 35 | field contains ARFMAG to help verify the presence of a header. |
6e5bb952 KM |
36 | The other fields are left-adjusted, blank-padded numbers. |
37 | They are decimal except for | |
38 | .IR ar_mode , | |
39 | which is octal. | |
40 | The date is the modification date of the file | |
41 | at the time of its insertion into the archive. | |
42 | .PP | |
43 | Each file begins on a even (0 mod 2) boundary; | |
44 | a new-line is inserted between files if necessary. | |
45 | Nevertheless the size given reflects the | |
46 | actual size of the file exclusive of padding. | |
47 | .PP | |
f4258d08 | 48 | There is no provision for empty areas in an archive file. |
6e5bb952 KM |
49 | .PP |
50 | The encoding of the header is portable across machines. | |
f4258d08 | 51 | If an archive contains printable files, the archive itself is printable. |
6e5bb952 KM |
52 | .SH "SEE ALSO" |
53 | ar(1), ld(1), nm(1) | |
54 | .SH BUGS | |
55 | File names lose trailing blanks. | |
56 | Most software dealing with archives takes even | |
57 | an included blank as a name terminator. |