1 .\" $OpenBSD: ar.1,v 1.2 1996/06/26 05:31:17 deraadt Exp $
2 .\" $NetBSD: ar.1,v 1.7 1995/08/18 15:05:11 pk Exp $
4 .\" Copyright (c) 1990, 1993
5 .\" The Regents of the University of California. All rights reserved.
7 .\" This code is derived from software contributed to Berkeley by
8 .\" Hugh Smith at The University of Guelph.
10 .\" Redistribution and use in source and binary forms, with or without
11 .\" modification, are permitted provided that the following conditions
13 .\" 1. Redistributions of source code must retain the above copyright
14 .\" notice, this list of conditions and the following disclaimer.
15 .\" 2. Redistributions in binary form must reproduce the above copyright
16 .\" notice, this list of conditions and the following disclaimer in the
17 .\" documentation and/or other materials provided with the distribution.
18 .\" 3. All advertising materials mentioning features or use of this software
19 .\" must display the following acknowledgement:
20 .\" This product includes software developed by the University of
21 .\" California, Berkeley and its contributors.
22 .\" 4. Neither the name of the University nor the names of its contributors
23 .\" may be used to endorse or promote products derived from this software
24 .\" without specific prior written permission.
26 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 .\" @(#)ar.1 8.1 (Berkeley) 6/29/93
45 .Nd create and maintain library archives
58 .Ar position archive file ...
75 .Ar position archive file ...
89 utility creates and maintains groups of files combined into an archive.
90 Once an archive has been created, new files can be added and existing
91 files can be extracted, deleted, or replaced.
93 Files are named in the archive by a single component, i.e., if a file
94 referenced by a path containing a slash (``/'') is archived it will be
95 named by the last component of that path.
96 When matching paths listed on the command line against file names stored
97 in the archive, only the last component of the path will be compared.
99 All informational and error messages use the path listed on the command
100 line, if any was specified, otherwise the name in the archive is used.
101 If multiple files in the archive have the same name, and paths are listed
102 on the command line to ``select'' archive files for an operation, only the
104 file with a matching name will be selected.
108 is for the creation and maintenance of libraries suitable for use with
111 although it is not restricted to this purpose.
112 The options are as follows:
113 .Bl -tag -width indent
115 A positioning modifier used with the options
119 The files are entered or moved
123 which must be specified.
125 A positioning modifier used with the options
129 The files are entered or moved
133 which must be specified.
135 Whenever an archive is created, an informational message to that effect
136 is written to standard error.
141 creates the archive silently.
143 Delete the specified archive files.
149 Move the specified archive files within the archive.
150 If one of the options
155 are specified, the files are moved before or after the
158 If none of those options are specified, the files are moved
159 to the end of the archive.
161 Set the access and modification times of extracted files to the
162 modification time of the file when it was entered into the archive.
163 This will fail if the user is not the owner of the extracted file
166 Write the contents of the specified archive files to the standard output.
167 If no files are specified, the contents of all the files in the archive
168 are written in the order they appear in the archive.
170 (Quickly) append the specified files to the archive.
171 If the archive does not exist a new archive file is created.
174 option, when creating a large archive
175 piece-by-piece, as no checking is done to see if the files already
176 exist in the archive.
178 Replace or add the specified files to the archive.
179 If the archive does not exist a new archive file is created.
180 Files that replace existing files do not change the order of the files
182 New files are appended to the archive unless one of the options
189 Select and/or name archive members using only the first fifteen characters
190 of the archive member or command line file name.
191 The historic archive format had sixteen bytes for the name, but some
192 historic archiver and loader implementations were unable to handle names
193 that used the entire space.
194 This means that file names that are not unique in their first fifteen
195 characters can subsequently be confused.
196 A warning message is printed to the standard error output if any file
200 for more information.)
202 Used the extended format to allow long archive member names. This is the
205 Write an object-file index into the archive, or update an existing one, even if
206 no other change is made to the archive. You may use this modifier flag either
207 with any operation, or alone. Running `ar s' on an archive is equivalent to
208 running `ranlib' on it.
210 Do not generate an archive symbol table. This can speed up building a large
211 library in several steps. The resulting archive can not be used with the
212 linker. In order to build a symbol table, you must omit the S modifier on the
213 last execution of ar, or you must run ranlib on the archive.
215 List the specified files in the order in which they appear in the archive,
216 each on a separate line.
217 If no files are specified, all files in the archive are listed.
222 option, files in the archive will be replaced
223 only if the disk file has a newer modification time than the file in
227 option, files in the archive will be extracted
228 only if the archive file has a newer modification time than the file
231 Provide verbose output.
240 gives a file-by-file description of the archive modification.
241 This description consists of three, white-space separated fields: the
242 option letter, a dash (``-'') and the file name.
247 displays the description as above, but the initial letter is an ``a'' if
248 the file is added to the archive and an ``r'' if the file replaces a file
249 already in the archive.
254 the name of each printed file is written to the standard output before
255 the contents of the file, preceded by a single newline character, and
256 followed by two newline characters, enclosed in less-than (``<'') and
257 greater-than (``>'') characters.
263 displays an ``ls -l'' style listing of information about the members of
265 This listing consists of eight, white-space separated fields:
266 the file permissions (see
268 the decimal user and group ID's, separated by a single slash (``/''),
269 the file size (in bytes), the file modification time (in the
271 format ``%b %e %H:%M %Y''), and the name of the file.
273 Extract the specified archive members into the files named by the command
275 If no members are specified, all the members of the archive are extracted into
276 the current directory.
278 If the file does not exist, it is created; if it does exist, the owner
279 and group will be unchanged.
280 The file access and modification times are the time of the extraction
284 The file permissions will be set to those of the file when it was entered
285 into the archive; this will fail if the user is not the owner of the
286 extracted file or the super-user.
291 utility exits 0 on success, and >0 if an error occurs.
293 .Bl -tag -width indent -compact
295 The pathname of the directory to use when creating temporary files.
298 .Bl -tag -width indent -compact
300 default temporary file directory
307 writes archives that may be incompatible with historic archives, as
308 the format used for storing archive members with names longer than
309 fifteen characters has changed.
310 This implementation of
312 is backward compatible with previous versions of
314 in that it can read and write (using the
316 option) historic archives.
319 option is provided for compatibility only, and will be deleted
323 for more information.
327 utility is expected to offer a superset of the