Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ar(1) — A/UX 2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ld(1)

lorder(1)

strip(1)

tar(1)

a.out(4)

ar(4)




ar(1) ar(1)
NAME ar - archive and library maintainer for portable archives SYNOPSIS ar key [clsuv] [abi posname] afile name ... DESCRIPTION ar maintains groups of files combined into a single archive file. Its main use is to create and update library files as used by the link editor, though it can be used for any simi- lar purpose. When ar creates an archive, it creates headers in a format that is portable across all machines. The portable archive format and structure are described in detail in ar(4). The archive symbol table (described in ar(4)) is used by the link editor (ld(1)) to effect multiple passes over libraries of object files in an efficient manner. Whenever the ar(1) command is used to create or update the contents of an ar- chive, the symbol table is rebuilt. The symbol table can be forcibly rebuilt by the s option, described later in this section. key is one character from the set dmpqrtx. Optionally, key may be concatenated with one or more of the letters in the group clsuv or in the group abi. afile is the archive file. The names are constituent files in the archive file. The meanings of the key characters are: d Deletes the named files from the archive file. m Moves the named files to the end of the archive. If a positioning character is present, then the posname ar- gument must be present and, as in the r key character, specifies where the files are to be moved. p Prints the named files in the archive. q Quickly appends the named files to the end of the ar- chive file. Optional positioning characters are in- valid. The q command does not check whether the added members are already in the archive and is useful only to avoid quadratic behavior when creating a large ar- chive piece-by-piece. r Replaces the named files in the archive file; that is, if the named file is not already included in the ar- chive file, then it will be placed into the archive. April, 1990 1



ar(1) ar(1)
New files are placed at the end of the archive, unless the default positioning is overridden by the specifica- tion of an optional positioning character from the set abi. The meaning of these positional characters is as follows: a posname Places the named file or files after posname. b posname Places the named file or files before posname. i posname Inserts the named file or files before posname. This is identical to the b positioning character. t Prints a table of contents of the archive file. If no names are given, all files in the archive are tabled. If names are given, only those files are tabled. x Extracts the named files. If no names are given, all files in the archive are extracted. In either case, x does not alter the archive file. Any of the flags clsuv may be included in addition to a key letter. These flags have the following meaning. c Create. Normally ar creates afile when it needs to. The create flag option suppresses the normal message that is produced when afile is created. l Local. Normally ar places its temporary files in the directory /tmp. This flag option causes them to be placed in the local directory. s Symbol table creation. Forces the regeneration of the archive symbol table even if ar(1) is not invoked with a command which will modify the archive contents. This command is useful to restore the archive symbol table after the strip(1) command has been used on the ar- chive. u Update. When used in conjunction with the r key letter, only those files whose modification dates are more recent than the modification date of the named ar- chive afile are replaced in the archive. v Verbose. Under the verbose flag option, ar gives a file-by-file description of the making of a new archive file from the old archive and the constituent files. When used with t, it gives a long listing of all infor- mation about the files. When used with x, it precedes 2 April, 1990



ar(1) ar(1)
each file with a name. EXAMPLES The command ar rc libfoo.a foo.o creates an archive file containing the object code foo.o. ar r libfoo.a bar.o adds the binary file bar.o to the end of the archive libfoo.a. ar ru libfoo.a *.o replaces in the archive file libfoo.a any object modules in the current directory that were modified after the most re- cent modification of the archive file itself. ar rb bar.o libfoo.a new.o inserts the object file new.o into the archive libfoo.a be- fore the already archived object file bar.o. FILES /bin/ar /tmp/ar* temporary files SEE ALSO ld(1), lorder(1), strip(1), tar(1), a.out(4), ar(4). BUGS If the same file is mentioned twice in an argument list, it may be put in the archive twice. April, 1990 3

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026