4BSD/usr/man/cat5/ar.5

Compare this file to the similar file:
Show the results in this format:




AR(5)               UNIX Programmer's Manual                AR(5)



NAME
     ar - archive (library) file format

SYNOPSIS
     #include <ar.h>

DESCRIPTION
     _N._B.: This archive format is new to this distribution.  See
     _o_l_d(8) and _a_r_c_v(1) for programs to deal with the old format.

     The archive command _a_r is used to combine several files into
     one.  Archives are used mainly as libraries to be searched
     by the link-editor _l_d.

     A file produced by _a_r has a magic string at the start, fol-
     lowed by the constituent files, each preceded by a file
     header.  The magic number and header layout as described in
     the include file are:

          #define ARMAG  "!<arch>\n"
          #define SARMAG 8

          #define ARFMAG "`\n"

          struct ar_hdr {
                  char   ar_name[16];
                  char   ar_date[12];
                  char   ar_uid[6];
                  char   ar_gid[6];
                  char   ar_mode[8];
                  char   ar_size[10];
                  char   ar_fmag[2];
          };

     The name is a blank-padded string.  The _a_r__f_m_a_g field con-
     tains ARFMAG to help verify the presence of a header.  The
     other fields are left-adjusted, blank-padded numbers.  They
     are decimal except for _a_r__m_o_d_e, which is octal.  The date is
     the modification date of the file at the time of its inser-
     tion into the archive.

     Each file begins on a even (0 mod 2) boundary; a new-line is
     inserted between files if necessary.  Nevertheless the size
     given reflects the actual size of the file exclusive of pad-
     ding.

     There is no provision for empty areas in an archive file.

     The encoding of the header is portable across machines.  If
     an archive contains printable files, the archive itself is
     printable.




Printed 11/10/80                                                1






AR(5)               UNIX Programmer's Manual                AR(5)



SEE ALSO
     ar(1), ld(1), nm(1)

BUGS
     File names lose trailing blanks.  Most software dealing with
     archives takes even an included blank as a name terminator.

















































Printed 11/10/80                                                2