|

|
|
|
ar -d [-TLv] archive file ...
ar -m [-TLv] archive file ...
ar -m [-abiTLv] position archive file ...
ar -p [-TLv] archive [file ...]
ar -q [-cTLv] archive file ...
ar -r [-cuTLv] archive file ...
ar -r [-abciuTLv] position archive file ...
ar -t [-TLv] archive [file ...]
ar -x [-ouTLv] archive [file ...]
DESCRIPTION
The ar utility creates and maintains groups of files combined into an
archive. Once an archive has been created, new files can be added and
existing files can be extracted, deleted, or replaced.
Files are named in the archive by a single component, i.e., if a file
referenced by a path containing a slash (``/'') is archived it will be
named by the last component of that path. When matching paths listed on
the command line against file names stored in the archive, only the last
component of the path will be compared.
All informational and error messages use the path listed on the command
line, if any was specified, otherwise the name in the archive is used.
If multiple files in the archive have the same name, and paths are listed
on the command line to ``select'' archive files for an operation, only
the first file with a matching name will be selected.
The normal use of ar is for the creation and maintenance of libraries
suitable for use with the loader (see ld(1)) although it is not re-
stricted to this purpose. The options are as follows:
-a A positioning modifier used with the options -r and -m. The files
are entered or moved after the archive member position, which
must be specified.
-b A positioning modifier used with the options -r and -m. The files
are entered or moved before the archive member position, which
must be specified.
-c Whenever an archive is created, an informational message to that
effect is written to standard error. If the -c option is speci-
fied, ar creates the archive silently.
-d Delete the specified archive files.
-i Identical to the -b option.
-m Move the specified archive files within the archive. If one of
the options -a, -b or -i are specified, the files are moved be-
fore or after the position file in the archive. If none of those
options are specified, the files are moved to the end of the
archive.
archive does not exist a new archive file is created. Much
faster than the -r option, when creating a large archive piece-
by-piece, as no checking is done to see if the files already ex-
ist in the archive.
-r Replace or add the specified files to the archive. If the
archive does not exist a new archive file is created. Files that
replace existing files do not change the order of the files with-
in the archive. New files are appended to the archive unless one
of the options -a, -b or -i is specified.
-T Select and/or name archive members using only the first fifteen
characters of the archive member or command line file name. The
historic archive format had sixteen bytes for the name, but some
historic archiver and loader implementations were unable to han-
dle names that used the entire space. This means that file names
that are not unique in their first fifteen characters can subse-
quently be confused. A warning message is printed to the stan-
dard error output if any file names are truncated. (See ar(5)
for more information.)
-L Used the extended format to allow long archive member names.
This is the default.
-t List the specified files in the order in which they appear in the
archive, each on a separate line. If no files are specified, all
files in the archive are listed.
-u Update files. When used with the -r option, files in the archive
will be replaced only if the disk file has a newer modification
time than the file in the archive. When used with the -x option,
files in the archive will be extracted only if the archive file
has a newer modification time than the file on disk.
-v Provide verbose output. When used with the -d, -m, -q or -x op-
tions, ar gives a file-by-file description of the archive modifi-
cation. This description consists of three, white-space separat-
ed fields: the option letter, a dash (``-'') and the file name.
When used with the -r option, ar displays the description as
above, but the initial letter is an ``a'' if the file is added to
the archive and an ``r'' if the file replaces a file already in
the archive.
When used with the -p option, the name of each printed file is
written to the standard output before the contents of the file,
preceded by a single newline character, and followed by two new-
line characters, enclosed in less-than (``<'') and greater-than
(``>'') characters.
When used with the -t option, ar displays an ``ls -l'' style
listing of information about the members of the archive. This
listing consists of eight, white-space separated fields: the file
is not the owner of the extracted file or the super-user.
The ar utility exits 0 on success, and >0 if an error occurs.
ENVIRONMENT
TMPDIR The pathname of the directory to use when creating temporary
files.
FILES
/tmp default temporary file directory
ar.XXXXXX
temporary file names
COMPATIBILITY
By default, ar writes archives that may be incompatible with historic
archives, as the format used for storing archive members with names
longer than fifteen characters has changed. This implementation of ar is
backward compatible with previous versions of ar in that it can read and
write (using the -T option) historic archives. The -T option is provided
for compatibility only, and will be deleted in a future release. See
ar(5) for more information.
STANDARDS
The ar utility is expected to offer a superset of the IEEE Std1003.2
(``POSIX'') functionality.
SEE ALSO
ld(1), ranlib(1), strmode(3), ar(5)
BSD Experimental June 29, 1993 3
|


|
Copyright © 2000-2010 Inside Mac Media, Inc. All rights reserved. |
Apple assumes no responsibility with regard to the selection, performance, or use of the products or services. All understandings, agreements, or warranties, if any, take place directly between the vendors and prospective users. |
| Apple, the Apple logo, Mac, PowerMac G4, PowerMac G5, Xserve, Xserve RAID, PowerBook, iBook, Airport, AirPort Extreme, iMac, eMac, iLife, iMovie, iCal, iPhoto, iTunes, QuickTime, FireWire, iPod, iSight, AppleWorks, Macintosh, Jaguar, Panther, Mac OS, Mac OS X and Mac OS X Server are trademarks of Apple Computer, Inc. |