Commit | Line | Data |
---|---|---|
46c6eca3 KT |
1 | .pa 1 |
2 | .he 'ARCHIVE (V)'3/15/72'ARCHIVE (V)' | |
3 | .ti 0 | |
4 | NAME archive (library) file format | |
5 | .sp | |
6 | .ti 0 | |
7 | DESCRIPTION The | |
8 | archive command ar\b\b__ is used to combine several files into | |
9 | one. | |
10 | Archives are used mainly as libraries to be searched | |
11 | by the link-editor ld\b\b__. | |
12 | ||
13 | A file produced by ar\b\b__ | |
14 | has a "magic number" at the start, | |
15 | followed by the constituent files, each preceded by a file header. | |
16 | The magic number is | |
17 | 177555(8) | |
18 | (it was chosen to be unlikely to occur anywhere else). | |
19 | The header of each file is 16 bytes long: | |
20 | ||
21 | .in +5 | |
22 | .ti -3 | |
23 | 0-7 | |
24 | .br | |
25 | file name, null padded on the right | |
26 | ||
27 | .ti -3 | |
28 | 8-11 | |
29 | .br | |
30 | Modification time of the file | |
31 | ||
32 | .ti -3 | |
33 | 12 | |
34 | .br | |
35 | User ID of file owner | |
36 | ||
37 | .ti -3 | |
38 | 13 | |
39 | .br | |
40 | file mode | |
41 | ||
42 | .ti -3 | |
43 | 14-15 | |
44 | .br | |
45 | file size | |
46 | ||
47 | .in -5 | |
48 | If the file is an odd number of bytes long, it is padded | |
49 | with a null byte, but the size in the header is correct. | |
50 | ||
51 | Notice there is no provision for empty areas in an archive | |
52 | file. | |
53 | .sp | |
54 | .ti 0 | |
55 | SEE ALSO ar\b\b__, ld\b\b__ |