Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ar(cmds) — Sprite KS.390

Media Vault

Software Library

Restoration Projects

Artifacts Sought

AR  —  User Commands

NAME

ar − archive maintenance

SYNOPSIS

ar flags [posname] archive [name name ...]

OPTIONS

aPosition the named files after posname.

bPosition the named files before posname.

cIf creating an archive for the first time, do it silently. 

dCommand: delete the named files from the archive. 

iPosition the named files before posname.

lIgnored.  This flag is kept for compatibility with the UNIX ar. 

mCommand: move the named files to a different location in the archive. 

oWhen extracting a file from the archive, give it the last-modified time that is recorded in the archive.  The default is to give it the current time. 

pCommand: print out the named files.  If no files are named, print out all files in the archive. 

qCommand: quickly append the named files to the archive.  If the named files already exist, the archive will end up with duplicates.  This command is intended for creating a new archive with lots of files with one invocation of ar. 

rCommand: replace the named files in the archive.  If a named file isn’t already in the archive, it is added. 

sCreate a __.SYMDEF file for the archive.  This flag may be used as a command or as a modifier to other commands. 

tCommand: list the named files in the archive.  If no files are named, the table of contents for the entire archive is listed. 

uIf replacing files, only replace a file if it is newer than the version in the archive (or if there is no version in the archive at all). 

vTurn on the “verbose” flag. 

xCommand: extract the named files from the archive.  If no files are named, extract all files in the archive. 
 

DESCRIPTION

Ar maintains archive files, which are collections of other files.  An archive file is usually used as a library of object files, for use with ld. 

Each invocation of ar always takes one command flag and an archive name.  It may also take modifier flags, which appear with the command letter.  For example, tv specifies the “table-of-contents” command, with the “verbose” flag turned on.  It is equivalent to vt.  If you specify any of the a, b, or i flags (for the m or r commands), you must also specify posname, which is the name of a file in the archive that other files will be positioned relative to.  The default is to place the files at the end of the archive.  Finally, most commands require that you specify one or more file names.  These names refer to files in the archive, files outside the archive, or both, depending on the command.

You may specify a complete path for any file name.  Ar will remove leading path information and truncate the file name to 15 characters to get the name of the file as it is stored in the archive.  However, the full given path will be used when referring to files outside the archive for the q, r, and x commands. 

Some UNIX linkers require that an object file library have a __.SYMDEF file, which contains a string table that the linker ld uses to resolve external references.  This version of ar maintains the __.SYMDEF file automatically, once it exists, and it will create the __.SYMDEF file if the s flag is specified.  Thus, ranlib, which is the program usually used to maintain the __.SYMDEF file, is not needed with this version of ar. 

The v flag has a varied effect, depending on the command involved.  For most commands, specifying the v flag merely causes ar to tell you what it’s doing as it does it.  For the t command, the v flag causes information about each file (other than just its name) to be printed.  This additional information consists of

•the permissions associated with the file (as displayed by
ls)

•the file’s owner and group (displayed as integers)

•the file’s length in bytes

•the last-modified time of the file
 

SEE ALSO

ranlib, ld, ls
 

KEYWORDS

archive, library

Sprite version 1.0  —  November 12, 1990

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