ar(FP) 6 January 1993 ar(FP) Name ar - archive file format Description The archive command ar is used to combine several files into one. Archives are used mainly as libraries to be searched by the link editor ld(CP). A file produced by ar has a magic number at the start, followed by the constituent files, each preceded by a file header. The magic number string is in a portable archive format that uses the ASCII string: !<arch>\n The header of each file is declared in /usr/include/ar.h. Each file begins on a word boundary; a null byte is inserted between files if necessary. The size given reflects the actual size of the file exclusive of padding. Notice there is no provision for empty areas in an archive file. Notes The ar(CP) utility now handles filenames longer than 14 characters so that the upper limit for the filename component is 512 characters and the limit for a full pathname is 1024 characters. Files with long filenames are stored in the archive using a short filename convention: LNGFILxxxxxx. Where the xxxxxx is an ASCII-encoded decimal serial number, for example, _LNGFIL000001 and _LNGFIL000002. These shortened filenames are used to identify the long filenames by tak- ing the serial numbers and using them as indexes into a map table of long filenames. Because of the encoding, up to 1,000,000 long filenames can be stored in an archive. A table containing the mapping information on long filenames (called the maptable) is stored in the archive as a regular (archived) file. This file (called the mapfile) is either the first or the second file in the archive depending on whether the archive file has a symbol table file or not. This mapfile is part of the archive if (and only if) there are files with long filenames. If there are any COFF files in the archive, the first archive member is the symbols table. If there are any files with long filenames, the map- file is the next file after the symbol table. The format of the long filenames table is: <stringnumber><seriallength><string> Where: + <stringnumber> is a 7-byte numeric ASCII string + <seriallength> is a 7-byte numeric ASCII string + <string> is a string of stringlength characters long. An example entry is: 00000190000001longfilenamemapfile The string length is 19 characters, the serial number entry is 1, and the string is longfilenamemapfile. See also ar(CP), ar(S), ld(CP)