

ar                           Command                           ar




The librarian/archiver

aarr _o_p_t_i_o_n [_m_o_d_i_f_i_e_r][_p_o_s_i_t_i_o_n] _a_r_c_h_i_v_e [_m_e_m_b_e_r ...]

The  librarian  ar edits  and  examines  libraries.  It  combines
several files into a file called an archive or library.  Archives
reduce the size of directories and allow many files to be handled
as a single unit.  The principal use of archives is for libraries
of object  files.  The linker ld  understands the archive format,
and  can search  libraries of object  files to  resolve undefined
references in a program.

The mandatory  option argument consists  of one of  the following
command keys:

dd  Delete  each given member from archive.   The ranlib header is
   updated if present.

mm   Move each  given member  within archive.   If no  modifier is
   given,  move each  member to  the end.   The ranlib  header is
   modified if present.

pp  Print each member.  This  is useful only with archives of text
   files.

qq  Quick append: append each  member to the end of archive uncon-
   ditionally.  The ranlib header is not updated.

rr  Replace  each member of  archive.  If archive  does not exist,
   create it.  The optional modifier specifies how to perform the
   replacement,  as  described   below.   The  ranlib  header  is
   modified if present.

tt  Print  a table of  contents that lists  each member specified.
   If none  is given, list all in archive.   The modifier v tells
   ar to give you additional information.

xx  Extract each given member and place it into the current direc-
   tory.  If none  is specified, extract all members.  archive is
   not changed.

The modifier may be one of the following.  The modifiers aa, bb, ii,
and uu may be used only with the m and r options.

aa  If member does not exist  in archive, insert it after the mem-
   ber named by the given position.

bb  If member does not exist in archive, insert it before the mem-
   ber named by the given position.

cc  Suppress  the message normally printed when  ar creates an ar-
   chive.




COHERENT Lexicon                                           Page 1




ar                           Command                           ar



ii  If member does not exist in archive, insert it before the mem-
   ber named  by the given position.   This is the same  as the b
   modifier, described above.

kk  Preserve  the modify time of a file.   This modifier is useful
   only with the r, q, and x options.

ss  Modify an archive's ranlib header, or create it if it does not
   exist.  This is used only with the r, m, and d options.

uu  Update archive only if member is newer than the version in the
   archive.

vv  Generate verbose messages.

All archives  are written into  a specialized file  format.  Each
archive starts with  a ``magic number'' called ARMAG, which iden-
tifies the file as an archive.  The members of the archive follow
the magic  number; each is preceded by  an ar_hdr structure.  For
information  on  this  structure,  see  ar.h.  The  structure  is
followed the  data of the file, which occupy  the number of bytes
specified by the variable ar_size.

***** See Also *****

ar.h, commands, ld, nm, ranlib

***** Notes *****

It is  recommended that each object-file  library you create with
ar have a name that begins  with the string lib.  This will allow
you to call that library with the -l option to the cc command.

























COHERENT Lexicon                                           Page 2


