<!DOCTYPE html PUBLIC "‐//W3C//DTD XHTML 1.1//EN"
        "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">     <html
xmlns="http://www.w3.org/1999/xhtml"> <head>
    <link            rel="stylesheet"             type="text/css"
href="../../../style.css" title="style" />
    <link  rel="stylesheet"  type="text/css"  href="../style.css"
title="style" />
    <meta             http‐equiv="content‐type"              con‐
tent="text/html;charset=utf‐8" />

    <title>ar.1p ‐ Linux manual page</title> </head>

<body>

<div        class="page‐top"><a       id="top_of_page"></a></div>
<!‐‐%%%TOP_BAR%%%‐‐> <!‐‐%%%PAGE_START%%%‐‐>

<table class="sec‐table"> <tr>
    <td>
        <p class="section‐dir"> <a href="#PROLOG">PROLOG</a> | <a
href="#NAME">NAME</a>  |  <a  href="#SYNOPSIS">SYNOPSIS</a>  | <a
href="#DESCRIPTION">DESCRIPTION</a>  |   <a   href="#OPTIONS">OP‐
TIONS</a>     |    <a    href="#OPERANDS">OPERANDS</a>    |    <a
href="#STDIN">STDIN</a>   |   <a    href="#INPUT_FILES">INPUT&nb‐
sp;FILES</a>  |  <a href="#ENVIRONMENT_VARIABLES">ENVIRONMENT&nb‐
sp;VARIABLES</a>   |   <a   href="#ASYNCHRONOUS_EVENTS">ASYNCHRO‐
NOUS&nbsp;EVENTS</a>   |   <a   href="#STDOUT">STDOUT</a>   |  <a
href="#STDERR">STDERR</a>  |  <a  href="#OUTPUT_FILES">OUTPUT&nb‐
sp;FILES</a>  | <a href="#EXTENDED_DESCRIPTION">EXTENDED&nbsp;DE‐
SCRIPTION</a> | <a href="#EXIT_STATUS">EXIT&nbsp;STATUS</a> |  <a
href="#CONSEQUENCES_OF_ERRORS">CONSEQUENCES&nbsp;OF&nbsp;ER‐
RORS</a>  |   <a   href="#APPLICATION_USAGE">APPLICATION&nbsp;US‐
AGE</a>  |  <a  href="#EXAMPLES">EXAMPLES</a>  | <a href="#RATIO‐
NALE">RATIONALE</a>  |  <a   href="#FUTURE_DIRECTIONS">FUTURE&nb‐
sp;DIRECTIONS</a>  |  <a  href="#SEE_ALSO">SEE&nbsp;ALSO</a> | <a
href="#COPYRIGHT">COPYRIGHT</a>
        </p>
    </td>
    <td class="search‐box">
        <div class="man‐search‐box">

            <form                method="get"                 ac‐
tion="http://www.google.com/search">
                <fieldset class="man‐search">
                    <input    type="text"    name="q"   size="10"
maxlength="255" value="" />
                    <input type="hidden"  name="sitesearch"  val‐
ue="man7.org/linux/man‐pages" />
                    <input  type="submit" name="sa" value="Search
online pages" />
                </fieldset>
            </form>

        </div>
    </td>
    <td> </td> </tr> </table>

<pre> <span class="headline">AR(1P)                    POSIX Pro‐
grammer’s  Manual                    AR(1P)</span>  </pre> <h2><a
id="PROLOG" href="#PROLOG"></a>PROLOG  &nbsp; &nbsp; &nbsp;  &nb‐
sp;        <a        href="#top_of_page"><span        class="top‐
link">top</span></a></h2><pre>
       This manual page is part of the POSIX Programmer’s Manual.
The Linux
       implementation of this interface may differ (consult the
       corresponding  Linux  manual page for details of Linux be‐
havior), or
       the interface may not be  implemented  on  Linux.   </pre>
<h2><a id="NAME" href="#NAME"></a>NAME  &nbsp; &nbsp; &nbsp; &nb‐
sp;        <a        href="#top_of_page"><span        class="top‐
link">top</span></a></h2><pre>
       ar  —  create  and maintain library archives </pre> <h2><a
id="SYNOPSIS" href="#SYNOPSIS"></a>SYNOPSIS  &nbsp; &nbsp; &nbsp;
&nbsp;       <a       href="#top_of_page"><span       class="top‐
link">top</span></a></h2><pre>
       ar −d <b>[</b>−v<b>] </b><i>archive file</i>...

       ar −m <b>[</b>−v<b>] </b><i>archive file</i>...
       ar −m −a <b>[</b>−v<b>] </b><i>posname archive file</i>...
       ar −m −b <b>[</b>−v<b>] </b><i>posname archive file</i>...
       ar −m −i <b>[</b>−v<b>] </b><i>posname archive file</i>...

       ar  −p   <b>[</b>−v<b>]   [</b>−s<b>]   </b><i>archive</i>
<b>[</b><i>file</i>...<b>]</b>

       ar −q <b>[</b>−cv<b>] </b><i>archive file</i>...

       ar −r <b>[</b>−cuv<b>] </b><i>archive file</i>...

       ar   −r   −a   <b>[</b>−cuv<b>]   </b><i>posname   archive
file</i>...
       ar   −r   −b   <b>[</b>−cuv<b>]   </b><i>posname   archive
file</i>...
       ar   −r   −i   <b>[</b>−cuv<b>]   </b><i>posname   archive
file</i>...

       ar  −t   <b>[</b>−v<b>]   [</b>−s<b>]   </b><i>archive</i>
<b>[</b><i>file</i>...<b>]</b>

       ar   −x  <b>[</b>−v<b>]  [</b>−sCT<b>]  </b><i>archive</i>
<b>[</b><i>file</i>...<b>]</b>  </pre>  <h2><a   id="DESCRIPTION"
href="#DESCRIPTION"></a>DESCRIPTION   &nbsp; &nbsp; &nbsp; &nbsp;
<a             href="#top_of_page"><span              class="top‐
link">top</span></a></h2><pre>
       The  <i>ar</i> utility is part of the Software Development
Utilities option.

       The <i>ar</i> utility can be used to create  and  maintain
groups of files
       combined  into an archive. Once an archive has been creat‐
ed, new files
       can be added, and existing files in an archive can be  ex‐
tracted,
       deleted, or replaced. When an archive consists entirely of
valid
       object files, the implementation shall format the  archive
so that it
       is  usable  as  a library for link editing (see <i>c99</i>
and <i>fort77</i>).  When
       some of the archived files are not valid object files, the
       suitability of the archive for library use  is  undefined.
If an
       archive  consists  entirely of printable files, the entire
archive
       shall be printable.

       When <i>ar</i> creates an archive, it creates  administra‐
tive information
       indicating  whether  a  symbol table is present in the ar‐
chive. When
       there is at least one object file  that  <i>ar</i>  recog‐
nizes as such in the
       archive,  an  archive symbol table shall be created in the
archive and
       maintained by <i>ar</i>; it is used by the link editor  to
search the
       archive.  Whenever the <i>ar</i> utility is used to create
or update the
       contents of such an archive, the symbol table shall be re‐
built. The
       <b>−s  </b>option  shall  force the symbol table to be re‐
built.

       All <i>file</i> operands can be pathnames. However,  files
within archives
       shall  be named by a filename, which is the last component
of the
       pathname used when the file was entered into the  archive.
The
       comparison  of  <i>file</i> operands to the names of files
in archives shall
       be performed by comparing the last component of the  oper‐
and to the
       name of the file in the archive.

       It  is  unspecified  whether multiple files in the archive
may be
       identically named. In the case  of  such  files,  however,
each <i>file</i> and
       <i>posname</i>  operand shall match only the first file in
the archive having
       a name that is the same as the last component of the oper‐
and.    </pre>  <h2><a  id="OPTIONS"  href="#OPTIONS"></a>OPTIONS
&nbsp;  &nbsp;   &nbsp;   &nbsp;   <a   href="#top_of_page"><span
class="top‐link">top</span></a></h2><pre>
       The  <i>ar</i>  utility  shall conform to the Base Defini‐
tions volume of
       POSIX.1‐2008,  <i>Section  12.2</i>,   <i>Utility   Syntax
Guidelines</i>, except for
       Guideline 9.

       The following options shall be supported:

       <b>−a         </b>Position  new files in the archive after
the file named by
                 the <i>posname</i> operand.

       <b>−b        </b>Position new files in the archive  before
the file named by
                 the <i>posname</i> operand.

       <b>−c         </b>Suppress  the diagnostic message that is
written to standard
                 error by default when the archive <i>archive</i>
is created.

       <b>−C         </b>Prevent  extracted  files from replacing
like‐named files in
                 the file system.  This  option  is  useful  when
<b>−T </b>is also
                 used,  to  prevent  truncated filenames from re‐
placing files
                 with the same prefix.

       <b>−d        </b>Delete  one  or  more  <i>file</i>s  from
<i>archive</i>.

       <b>−i         </b>Position new files in the archive before
the file in the
                 archive  named  by  the  <i>posname</i>  operand
(equivalent to <b>−b</b>).

       <b>−m         </b>Move the named files in the archive. The
<b>−a</b>, <b>−b</b>, or <b>−i</b>
                 options with the <i>posname</i> operand indicate
the position;
                 otherwise,  move  the names files in the archive
to the end
                 of the archive.

       <b>−p        </b>Write the contents of the <i>file</i>s in
the archive named by
                 <i>file</i>  operands from <i>archive</i> to the
standard output. If no
                 <i>file</i> operands are specified, the contents
of all files in
                 the archive shall be written in the order of the
archive.

       <b>−q        </b>Append the named files to the end of  the
archive. In this
                 case  <i>ar</i> does not check whether the added
files are already
                 in the archive.  This is useful  to  bypass  the
searching
                 otherwise  done  when  creating  a large archive
piece by
                 piece.

       <b>−r        </b>Replace or  add  <i>file</i>s  to  <i>ar‐
chive</i>.  If the archive named by
                 <i>archive</i>  does  not  exist,  a new archive
shall be created and
                 a diagnostic message shall be written  to  stan‐
dard error
                 (unless  the  <b>−c </b>option is specified). If
no <i>file</i>s are
                 specified and the <i>archive</i> exists, the re‐
sults are
                 undefined.  Files that replace existing files in
the archive
                 shall not change the order of the archive. Files
that do
                 not  replace existing files in the archive shall
be appended
                 to the archive unless a <b>−a</b>, <b>−b</b>, or
<b>−i </b>option specifies
                 another position.

       <b>−s         </b>Force  the  regeneration  of the archive
symbol table even if
                 <i>ar</i> is not invoked  with  an  option  that
modifies the archive
                 contents.  This  option is useful to restore the
archive
                 symbol table after it  has  been  stripped;  see
<i>strip</i>.

       <b>−t         </b>Write  a  table  of  contents  of <i>ar‐
chive</i> to the standard
                 output.  Only  the  files   specified   by   the
<i>file</i> operands shall
                 be   included   in   the  written  list.  If  no
<i>file</i> operands are
                 specified, all files in <i>archive</i> shall  be
included in the
                 order of the archive.

       <b>−T         </b>Allow  filename  truncation of extracted
files whose archive
                 names are longer than the file system  can  sup‐
port. By
                 default,  extracting  a file with a name that is
too long
                 shall be an error; a diagnostic message shall be
written
                 and the file shall not be extracted.

       <b>−u         </b>Update  older files in the archive. When
used with the <b>−r</b>
                 option, files in the archive shall  be  replaced
only if the
                 corresponding  <i>file</i>  has  a  modification
time that is at least
                 as new as the modification time of the  file  in
the archive.

       <b>−v         </b>Give  verbose output. When used with the
option characters
                 <b>−d</b>, <b>−r</b>, or <b>−x</b>, write a  de‐
tailed file‐by‐file description of
                 the  archive  creation and maintenance activity,
as described
                 in the STDOUT section.

                 When used with <b>−p</b>, write the name of  the
file in the
                 archive  to  the  standard output before writing
the file in
                 the archive itself to the  standard  output,  as
described in
                 the STDOUT section.

                 When used with <b>−t</b>, include a long listing
of information
                 about the files in the archive, as described  in
the STDOUT
                 section.

       <b>−x        </b>Extract the files in the archive named by
the <i>file</i> operands
                 from <i>archive</i>.  The contents  of  the  ar‐
chive shall not be
                 changed.  If  no <i>file</i> operands are given,
all files in the
                 archive shall  be  extracted.  The  modification
time of each
                 file extracted shall be set to the time the file
is
                 extracted  from  the  archive.   </pre>   <h2><a
id="OPERANDS" href="#OPERANDS"></a>OPERANDS  &nbsp; &nbsp; &nbsp;
&nbsp;       <a       href="#top_of_page"><span       class="top‐
link">top</span></a></h2><pre>
       The following operands shall be supported:

       <i>archive</i>   A pathname of the archive.

       <i>file</i>      A pathname. Only the last component shall
be used when
                 comparing against the names of files in the  ar‐
chive. If two
                 or  more <i>file</i> operands have the same last
pathname component
                 (basename), the results are unspecified. The
                 implementation’s archive format shall not  trun‐
cate valid
                 filenames  of  files added to or replaced in the
archive.

       <i>posname</i>   The name of a file in the  archive,  used
for relative
                 positioning;    see    options   <b>−m   </b>and
<b>−r</b>.   </pre>  <h2><a  id="STDIN"   href="#STDIN"></a>STDIN
&nbsp;   &nbsp;   &nbsp;   &nbsp;   <a  href="#top_of_page"><span
class="top‐link">top</span></a></h2><pre>
       Not  used.   </pre>  <h2><a  id="INPUT_FILES"   href="#IN‐
PUT_FILES"></a>INPUT   FILES   &nbsp;  &nbsp;  &nbsp;  &nbsp;  <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       The archive named by <i>archive</i> shall be a file in the
format created by
       <i>ar</i> <b>−r</b>.  </pre> <h2><a  id="ENVIRONMENT_VARI‐
ABLES"   href="#ENVIRONMENT_VARIABLES"></a>ENVIRONMENT  VARIABLES
&nbsp;  &nbsp;   &nbsp;   &nbsp;   <a   href="#top_of_page"><span
class="top‐link">top</span></a></h2><pre>
       The  following environment variables shall affect the exe‐
cution of <i>ar</i>:

       <i>LANG</i>      Provide a default value for the  interna‐
tionalization
                 variables  that are unset or null. (See the Base
Definitions
                 volume  of  POSIX.1‐2008,  <i>Section   8.2</i>,
<i>Internationalization</i>
                 <i>Variables</i>  for the precedence of interna‐
tionalization
                 variables used to determine the values of locale
                 categories.)

       <i>LC_ALL</i>    If set to a non‐empty string value, over‐
ride the values of
                 all the other internationalization variables.

       <i>LC_CTYPE</i>   Determine the locale for the interpreta‐
tion of sequences of
                 bytes of text data as characters  (for  example,
single‐byte
                 as opposed to multi‐byte characters in arguments
and input
                 files).

       <i>LC_MESSAGES</i>
                 Determine the locale that should be used to  af‐
fect the
                 format and contents of diagnostic messages writ‐
ten to
                 standard error.

       <i>LC_TIME</i>   Determine the format and content for date
and time strings
                 written by <i>ar</i> <b>−tv</b>.

       <i>NLSPATH</i>    Determine  the location of message cata‐
logs for the
                 processing of <i>LC_MESSAGES</i>.

       <i>TMPDIR</i>    Determine the pathname that overrides the
default directory
                 for temporary files, if any.

       <i>TZ</i>         Determine the timezone used to calculate
date and time
                 strings written  by  <i>ar</i>  <b>−tv</b>.   If
<i>TZ</i> is unset or null, an
                 unspecified  default  timezone  shall  be  used.
</pre>    <h2><a    id="ASYNCHRONOUS_EVENTS"     href="#ASYNCHRO‐
NOUS_EVENTS"></a>ASYNCHRONOUS EVENTS  &nbsp; &nbsp; &nbsp; &nbsp;
<a             href="#top_of_page"><span              class="top‐
link">top</span></a></h2><pre>
       Default.     </pre>    <h2><a    id="STDOUT"   href="#STD‐
OUT"></a>STDOUT     &nbsp;    &nbsp;     &nbsp;     &nbsp;     <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       If the <b>−d </b>option is used with the <b>−v </b>option,
the standard output
       format shall be:

           <b>"d − %s0, &lt;</b><i>file</i>&gt;

       where  <i>file</i> is the operand specified on the command
line.

       If the <b>−p </b>option is used with the <b>−v </b>option,
<i>ar</i> shall precede the
       contents of each file with:

           <b>"0lt;%s&gt;0, &lt;</b><i>file</i>&gt;

       where  <i>file</i> is the operand specified on the command
line, if <i>file</i>
       operands were specified, and the name of the file  in  the
archive if
       they were not.

       If the <b>−r </b>option is used with the <b>−v </b>option:

        *  If <i>file</i> is already in the archive, the standard
output format
           shall be:

               <b>"r − %s0, &lt;</b><i>file</i>&gt;

           where &lt;<i>file</i>&gt; is the operand specified  on
the command line.

        *   If  <i>file</i>  is  not  already in the archive, the
standard output format
           shall be:

               <b>"a − %s0, &lt;</b><i>file</i>&gt;

           where &lt;<i>file</i>&gt; is the operand specified  on
the command line.

       If the <b>−t </b>option is used, <i>ar</i> shall write the
names of the files in
       the archive to the standard output in the format:

           <b>"%s0, &lt;</b><i>file</i>&gt;

       where <i>file</i> is the operand specified on the  command
line, if <i>file</i>
       operands  were  specified,  or the name of the file in the
archive if
       they were not.

       If the <b>−t </b>option is used with the <b>−v </b>option,
the standard output
       format shall be:

           <b>"%s  %u/%u %u %s %d %d:%d %d %s0, &lt;</b><i>member
mode</i>&gt;, &lt;<i>user ID</i>&gt;,
               &lt;<i>group ID</i>&gt;, &lt;<i>number of bytes in
member</i>&gt;,
               &lt;<i>abbreviated  month</i>&gt;,  &lt;<i>day‐of‐
month</i>&gt;, &lt;<i>hour</i>&gt;,
               &lt;<i>minute</i>&gt;,        &lt;<i>year</i>&gt;,
&lt;<i>file</i>&gt;

       where:

       &lt;<i>file</i>&gt;     Shall  be the operand specified on
the command line, if <i>file</i>
                 operands were specified, or the name of the file
in the
                 archive if they were not.

       &lt;<i>member mode</i>&gt;
                 Shall  be  formatted the same as the &lt;<i>file
mode</i>&gt; string
                 defined in the STDOUT section of <i>ls</i>,  ex‐
cept that the first
                 character, the &lt;<i>entry type</i>&gt;, is not
used; the string
                 represents the file mode of the file in the  ar‐
chive at the
                 time it was added to or replaced in the archive.

       The  following  represent  the last‐modification time of a
file when it
       was most recently added to or replaced in the archive:

       &lt;<i>abbreviated month</i>&gt;
                 Equivalent to the format of the  <b>%b  </b>con‐
version specification
                 format in <i>date</i>.

       &lt;<i>day‐of‐month</i>&gt;
                 Equivalent  to  the format of the <b>%e </b>con‐
version specification
                 format in <i>date</i>.

       &lt;<i>hour</i>&gt;    Equivalent to  the  format  of  the
<b>%H </b>conversion specification
                 format in <i>date</i>.

       &lt;<i>minute</i>&gt;   Equivalent  to  the  format of the
<b>%M </b>conversion specification
                 format in <i>date</i>.

       &lt;<i>year</i>&gt;    Equivalent to  the  format  of  the
<b>%Y </b>conversion specification
                 format in <i>date</i>.

       When  <i>LC_TIME</i>  does not specify the POSIX locale, a
different format
       and order of presentation of these fields relative to each
other may
       be used in a format appropriate in the specified locale.

       If the <b>−x </b>option is used with the <b>−v </b>option,
the standard output
       format shall be:

           <b>"x − %s0, &lt;</b><i>file</i>&gt;

       where <i>file</i> is the operand specified on the  command
line, if <i>file</i>
       operands  were  specified,  or the name of the file in the
archive if
       they    were    not.     </pre>     <h2><a     id="STDERR"
href="#STDERR"></a>STDERR    &nbsp;   &nbsp;   &nbsp;  &nbsp;  <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       The  standard error shall be used only for diagnostic mes‐
sages.  The
       diagnostic message about creating a new archive when <b>−c
</b>is not
       specified shall not modify the exit status.  </pre> <h2><a
id="OUTPUT_FILES" href="#OUTPUT_FILES"></a>OUTPUT  FILES   &nbsp;
&nbsp;  &nbsp;  &nbsp;  <a  href="#top_of_page"><span class="top‐
link">top</span></a></h2><pre>
       Archives  are  files  with  unspecified  formats.   </pre>
<h2><a     id="EXTENDED_DESCRIPTION"     href="#EXTENDED_DESCRIP‐
TION"></a>EXTENDED DESCRIPTION  &nbsp; &nbsp;  &nbsp;  &nbsp;  <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       None.   </pre>  <h2><a  id="EXIT_STATUS"  href="#EXIT_STA‐
TUS"></a>EXIT    STATUS    &nbsp;   &nbsp;   &nbsp;   &nbsp;   <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       The following exit values shall be returned:

        0    Successful completion.

       &gt;0     An  error  occurred.   </pre>  <h2><a id="CONSE‐
QUENCES_OF_ERRORS"      href="#CONSEQUENCES_OF_ERRORS"></a>CONSE‐
QUENCES    OF    ERRORS    &nbsp;   &nbsp;   &nbsp;   &nbsp;   <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       Default.

       <i>The  following  sections  are  informative.</i>  </pre>
<h2><a  id="APPLICATION_USAGE"  href="#APPLICATION_USAGE"></a>AP‐
PLICATION    USAGE     &nbsp;    &nbsp;    &nbsp;    &nbsp;    <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       None.     </pre>    <h2><a    id="EXAMPLES"   href="#EXAM‐
PLES"></a>EXAMPLES     &nbsp;    &nbsp;    &nbsp;    &nbsp;    <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       None.    </pre>   <h2><a   id="RATIONALE"    href="#RATIO‐
NALE"></a>RATIONALE     &nbsp;    &nbsp;    &nbsp;    &nbsp;   <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       The archive format is not described. It is recognized that
there are
       several known <i>ar</i> formats, which are not compatible.
The <i>ar</i> utility is
       included,  however, to allow creation of archives that are
intended
       for use only on one machine. The archive is specified as a
file, and
       it  can  be moved as a file. This does allow an archive to
be moved
       from one machine to another machine that uses the same im‐
plementation
       of <i>ar</i>.

       Utilities such as <i>pax</i> (and its forebears <i>tar</i>
and <i>cpio</i>) also provide
       portable ‘‘archives’’. This is a not  a  duplication;  the
<i>ar</i> utility is
       included to provide an interface primarily for <i>make</i>
and the
       compilers, based on a historical model.

       In  historical  implementations,  the   <b>−q   </b>option
(available on XSI‐
       conforming  systems)  is  known to execute quickly because
<i>ar</i> does not
       check on whether the added members are already in the  ar‐
chive. This
       is useful to bypass the searching otherwise done when cre‐
ating a
       large archive piece‐by‐piece. These remarks may  but  need
not remain
       true  for  a  brand  new  implementation  of this utility;
hence, these
       remarks have been moved into the RATIONALE.

       BSD implementations historically required applications  to
provide the
       <b>−s </b>option whenever the archive was supposed to con‐
tain a symbol
       table.  As in this volume of POSIX.1‐2008, System  V  his‐
torically
       creates or updates an archive symbol table whenever an ob‐
ject file is
       removed from, added to, or updated in the archive.

       The OPERANDS section requires what might seem to  be  true
without
       specifying  it:  the archive cannot truncate the filenames
below
       {NAME_MAX}.  Some historical implementations do so, howev‐
er, causing
       unexpected  results  for  the application. Therefore, this
volume of
       POSIX.1‐2008 makes the requirement explicit to avoid
       misunderstandings.

       According to  the  System  V  documentation,  the  options
<b>−dmpqrtx </b>are not
       required  to  begin  with  a  &lt;hyphen&gt; (<b>’−’</b>).
This volume of POSIX.1‐2008
       requires that a conforming  application  use  the  leading
&lt;hyphen&gt;.

       The  archive  format used by the 4.4 BSD implementation is
documented
       in this RATIONALE as an example:

              A file created by <i>ar</i> begins with the  ‘‘mag‐
ic’’ string
              <b>"!&lt;arch&gt;0</b>.  The rest of the archive is
made up of objects,
              each of which is composed of a header for a file, a
possible
              filename, and the file contents. The header is por‐
table
              between machine architectures,  and,  if  the  file
contents are
              printable, the archive is itself printable.

              The header is made up of six ASCII fields, followed
by a two‐
              character trailer. The fields are the  object  name
(16
              characters),  the  file  last modification time (12
characters),
              the user and group IDs  (each  6  characters),  the
file mode (8
              characters), and the file size (10 characters). All
numeric
              fields are in decimal, except for  the  file  mode,
which is in
              octal.

              The  modification  time is the file <i>st_mtime</i>
field. The user and
              group  IDs   are   the   file   <i>st_uid</i>   and
<i>st_gid</i> fields. The file mode
              is  the file <i>st_mode</i> field. The file size is
the file <i>st_size</i>
              field.  The  two‐byte   trailer   is   the   string
<b>"‘&lt;newline&gt;"</b>.

              Only the name field has any provision for overflow.
If any
              filename is more than 16 characters  in  length  or
contains an
              embedded space, the string <b>"#1/" </b>followed by
the ASCII length
              of the name is written in the name field.  The file
size
              (stored  in  the  archive header) is incremented by
the length of
              the name. The name is then written immediately fol‐
lowing the
              archive header.

              Any  unused  characters  in any of these fields are
written as
              &lt;space&gt; characters. If any fields  are  their
particular maximum
              number of characters in length, there is no separa‐
tion between
              the fields.

              Objects in the archive are always an even number of
bytes
              long;  files  that  are an odd number of bytes long
are padded
              with a &lt;newline&gt;, although the  size  in  the
header does not
              reflect this.

       The  <i>ar</i> utility description requires that (when all
its members are
       valid object files) <i>ar</i> produce an object  code  li‐
brary, which the
       linkage  editor  can use to extract object modules. If the
linkage
       editor needs a symbol table to permit random access to the
archive,
       <i>ar</i> must provide it; however, <i>ar</i> does not re‐
quire a symbol table.

       The BSD <b>−o </b>option was omitted. It is  a  rare  con‐
forming application
       that  uses <i>ar</i> to extract object code from a library
with concern for
       its modification time, since this can only  be  of  impor‐
tance to <i>make</i>.
       Hence,  since  this  functionality is not deemed important
for
       applications portability, the modification time of the ex‐
tracted
       files is set to the current time.

       There  is  at  least one known implementation (for a small
computer)
       that can accommodate only object files  for  that  system,
disallowing
       mixed  object  and  other files. The ability to handle any
type of file
       is not only historical practice for most  implementations,
but is also
       a reasonable expectation.

       Consideration  was  given to changing the output format of
<i>ar</i> <b>−tv </b>to
       the same format as  the  output  of  <i>ls</i>  <b>−l</b>.
This would have made parsing
       the  output  of  <i>ar</i>  the same as that of <i>ls</i>.
This was rejected in part
       because the current <i>ar</i> format is commonly used  and
changes would
       break  historical usage.  Second, <i>ar</i> gives the user
ID and group ID in
       numeric format separated  by  a  &lt;slash&gt;.   Changing
this to be the user
       name  and  group  name would not be correct if the archive
were moved to
       a machine that contained a different user database.  Since
<i>ar</i> cannot
       know  whether  the  archive  was generated on the same ma‐
chine, it cannot
       tell what to report.

       The text on the <b>−ur </b>option combination is  histori‐
cal practice—since
       one filename can easily represent two different files (for
example,
       <b>/a/foo </b>and <b>/b/foo</b>), it is reasonable to  re‐
place the file in the
       archive  even when the modification time in the archive is
identical
       to that in the file system.  </pre> <h2><a  id="FUTURE_DI‐
RECTIONS" href="#FUTURE_DIRECTIONS"></a>FUTURE DIRECTIONS  &nbsp;
&nbsp; &nbsp;  &nbsp;  <a  href="#top_of_page"><span  class="top‐
link">top</span></a></h2><pre>
       None.     </pre>   <h2><a   id="SEE_ALSO"   href="#SEE_AL‐
SO"></a>SEE   ALSO     &nbsp;    &nbsp;    &nbsp;    &nbsp;    <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       <a       href="../man1/c99.1p.html">c99(1p)</a>,        <a
href="../man1/date.1p.html">date(1p)</a>,                      <a
href="../man1/fort77.1p.html">fort77(1p)</a>,                  <a
href="../man1/pax.1p.html">pax(1p)</a>,                        <a
href="../man1/strip.1p.html">strip(1p)</a>

       The Base Definitions volume  of  POSIX.1‐2008,  <i>Chapter
8</i>, <i>Environment</i>
       <i>Variables</i>,  <i>Section  12.2</i>, <i>Utility Syntax
Guidelines</i>,                                                <a
href="../man0/unistd.h.0p.html">unistd.h(0p)</a>,
       description  of  {POSIX_NO_TRUNC}  </pre> <h2><a id="COPY‐
RIGHT" href="#COPYRIGHT"></a>COPYRIGHT  &nbsp; &nbsp; &nbsp; &nb‐
sp;        <a        href="#top_of_page"><span        class="top‐
link">top</span></a></h2><pre>
       Portions of this text  are  reprinted  and  reproduced  in
electronic form
       from  IEEE Std 1003.1, 2013 Edition, Standard for Informa‐
tion
       Technology ‐‐ Portable Operating System Interface (POSIX),
The Open
       Group  Base  Specifications Issue 7, Copyright (C) 2013 by
the
       Institute of Electrical and Electronics Engineers, Inc and
The Open
       Group.  (This is POSIX.1‐2008 with the 2013 Technical Cor‐
rigendum 1
       applied.) In the event of  any  discrepancy  between  this
version and
       the  original IEEE and The Open Group Standard, the origi‐
nal IEEE and
       The Open Group Standard is the referee document. The orig‐
inal
       Standard     can     be     obtained    online    at    <a
href="http://www.unix.org/online.html">http://www.unix.org/on‐
line.html</a> .

       Any typographical or formatting errors that appear in this
page are
       most likely to have been introduced during the  conversion
of the
       source  files  to  man page format. To report such errors,
see
       <a      href="https://www.kernel.org/doc/man‐pages/report‐
ing_bugs.html">https://www.kernel.org/doc/man‐pages/report‐
ing_bugs.html</a> .

<span class="footline">IEEE/The Open  Group                  2013
AR(1P)</span> </pre>

<hr class="end‐man‐text" />

<hr class="start‐footer" />

<div class="footer">

<table class="colophon‐table">
    <tr>
    <td class="pub‐info">
        <p>
            HTML rendering created 2019‐08‐02
            by  <a  href="http://man7.org/mtk/index.html">Michael
Kerrisk</a>,
            author of
            <a  href="http://man7.org/tlpi/"><em>The  Linux  Pro‐
gramming Interface</em></a>,
            maintainer of the
            <a href="https://www.kernel.org/doc/man‐pages/">Linux
<em>man‐pages</em> project</a>.
        </p>
        <p>
            For details of in‐depth
            <strong>Linux/UNIX system programming training  cour‐
ses</strong>
            that  I  teach,  look <a href="http://man7.org/train‐
ing/">here</a>.
        </p>
        <p>
            Hosting   by    <a    href="http://www.jambit.com/in‐
dex_en.html">jambit GmbH</a>.
        </p>
        <p>
            <a href="http://validator.w3.org/check?uri=referer">
            <img src="http://www.w3.org/Icons/valid‐xhtml11"
                alt="Valid XHTML 1.1" height="31" width="88" />
            </a>
        </p>
    </td>
    <td class="colophon‐divider">
    </td>
    <td class="tlpi‐cover">
        <a                      href="http://man7.org/tlpi/"><img
src="http://man7.org/tlpi/cover/TLPI‐front‐cover‐vsmall.png"
alt="Cover of TLPI" /></a>
    </td>
    </tr> </table>

</div>

<hr class="end‐footer" />

</body> </html>