Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ar(1) — SunOS 3.5

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

lorder(1)

ld(1)

ranlib(1)

ar(5)

AR(1)  —  USER COMMANDS

NAME

ar − library archiver

SYNOPSIS

ar d|m|p|q|r|t|x [ ab position ] [ cilouv ] archive [ member-file ... ]

DESCRIPTION

ar maintains library archives.  A library comprises a set of member files and header information for each, been combined to form a single archive file (see ar(5)). ar is normally used to create and update library files used by the link editor ld(1), but can be used for any similar purpose.

archive is the name of the archive file.  member-file is a member file contained in the archive.  If this argument is omitted, the command applies to all entries in the archive.  Member names have a maximum of 15 characters.  Names longer than this are truncated. 

OPTIONS

You must indicate one of: d, m, p, q, r, t, or x, which may be followed by one or more of the modifiers abcilouv. 

d Delete the named files from the archive file. 

m Move the named files to the end of the archive. 

p Display the named files in the archive. 

q Quick append.  Append the named files to the end of the archive file without searching the archive for duplicate names.  Useful only to avoid quadratic behavior when creating a large archive piece-by-piece. 

r Replace the named files in the archive. 

t Display a table of contents of the archive file.  If no names are given, all files in the archive are listed; if names are given, only those files are listed. 

x Extract the named files.  If no names are given, all files in the archive are extracted.  In neither case does x alter the archive file. 

MODIFIERS

a Place new files after posname (posname argument must be present).  Applies only to the r and m options. 

b Place new files before posname (posname argument must be present).  Applies only to the r and m options. 

c Normally ar creates archive when it needs to, and displays a message to this effect.  The c modifier suppresses this message. 

i Identical to the b modifier. 

l Local.  Ar places its temporary files in the directory /tmp.  The l modifier places them in the local directory instead. 

o Old date.  When files are extracted with the x option, o sets the "last modified" date to the date recorded in the archive. 

u Replace only those files that have changed since they were put in the archive.  Used with the r option. 

v Verbose. Give a file-by-file description of the creation of a new archive file from the old archive and the constituent files.  When used with t, it gives a long listing of information about the files.  When used with p, it precedes each file with a name. 

EXAMPLES

Creating a new archive:

hermes% ar rcv archive file.o
a - file.o

Adding to an archive:

hermes% ar rav file.o archive next.c
a - next.c

Extracting from an archive:

hermes% ar xv archive file.o
x - file.o
hermes% ls file.o
file.o

Seeing the table of contents:

hermes% ar t archive
file.o
next.c

FILES

/tmp/v∗ temporaries

SEE ALSO

lorder(1), ld(1), ranlib(1), ar(5)

BUGS

If the same file is mentioned twice in the argument list, it is entered into the archive twice. 

The "last-modified" date of a file is not altered by the o option, unless the user is either the owner of the extracted file or the super-user. 

Sun Release 3.5  —  Last change: 13 January 1987

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