1 .\" Copyright (c) 2007 Joseph Koshy. All rights reserved.
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
6 .\" 1. Redistributions of source code must retain the above copyright
7 .\" notice, this list of conditions and the following disclaimer.
8 .\" 2. Redistributions in binary form must reproduce the above copyright
9 .\" notice, this list of conditions and the following disclaimer in the
10 .\" documentation and/or other materials provided with the distribution.
12 .\" This software is provided by Joseph Koshy ``as is'' and
13 .\" any express or implied warranties, including, but not limited to, the
14 .\" implied warranties of merchantability and fitness for a particular purpose
15 .\" are disclaimed. in no event shall Joseph Koshy be liable
16 .\" for any direct, indirect, incidental, special, exemplary, or consequential
17 .\" damages (including, but not limited to, procurement of substitute goods
18 .\" or services; loss of use, data, or profits; or business interruption)
19 .\" however caused and on any theory of liability, whether in contract, strict
20 .\" liability, or tort (including negligence or otherwise) arising in any way
21 .\" out of the use of this software, even if advised of the possibility of
45 .Op Fl a Ar position-after
46 .Op Fl b Ar position-before
47 .Op Fl i Ar position-before
62 .Op Fl a Ar position-after
63 .Op Fl b Ar position-before
66 .Op Fl i Ar position-before
99 utility creates and maintains groups of files combined into an
101 Once an archive has been created, new files can be added to it, and
102 existing files can be extracted, deleted or replaced.
104 Files are named in the archive by their last file name component,
105 so if a file referenced by a path containing a
107 is archived, it will be named by the last component of the path.
108 Similarly when matching paths listed on the command line against
109 file names stored in the archive, only the last component of the
110 path will be compared.
114 is for the creation and maintenance of libraries suitable for use
117 although it is not restricted to this purpose.
120 utility can create and manage an archive symbol table (see
122 used to speed up link editing operations.
123 If a symbol table is present in an archive, it will be
124 kept up-to-date by subsequent operations on the archive (excepting
125 the quick update specified by the
131 utility is used to add an archive symbol table
132 to an existing archive.
136 utility supports the following options:
137 .Bl -tag -width indent
138 .It Fl a Ar member-after
139 When used with option
141 this option specifies that the archive members specified by
144 are moved to after the archive member named by argument
146 When used with option
148 this option specifies that the files specified by arguments
150 are added after the archive member named by argument
152 .It Fl b Ar member-before
153 When used with option
155 this option specifies that the archive members specified by
158 are moved to before the archive member named by argument
160 When used with option
162 this option specifies that the files specified by arguments
164 are added before the archive member named by argument
167 Suppress the informational message printed when a new archive is
174 Prevent extracted files from replacing like-named files
177 Delete the members named by arguments
179 from the archive specified by argument
181 The archive's symbol table, if present, is updated to reflect
182 the new contents of the archive.
184 When used in combination with the
188 option, insert 0's instead of the real mtime, uid and gid values
189 and 0644 instead of file mode from the members named by arguments
191 This ensures that checksums on the resulting archives are reproducible
192 when member contents are identical.
194 Synonymous with option
196 .It Fl i Ar member-before
197 Synonymous with option
200 This option is accepted but ignored.
202 Move archive members specified by arguments
205 If a position has been specified by one of the
210 options, the members are moved to before or after the specified
212 If no position has been specified, the specified members are moved
213 to the end of the archive.
214 If the archive has a symbol table, it is updated to reflect the
215 new contents of the archive.
217 Preserve the original modification times of members when extracting
220 Write the contents of the specified archive members named by
224 If no members were specified, the contents of all the files in the
225 archive are written in the order they appear in the archive.
227 Append the files specified by arguments
229 to the archive specified by argument
231 without checking if the files already exist in the archive and
232 without updating the archive's symbol table.
235 does not already exist, a new archive is created.
236 However, to be compatible with GNU
240 will update the archive's symbol table.
242 Replace (add) the files specified by arguments
244 in the archive specified by argument
246 creating the archive if necessary.
247 Files that replace existing files do not change the order of files
249 If a file named in arguments
251 does not exist, existing members in the archive that match that
252 name are not changed.
253 New files are added to the end of the archive unless one of the
260 The archive symbol table, if it exists, is updated to reflect the
261 new state of the archive.
263 Add an archive symbol table (see
265 to the archive specified by argument
271 option alone is equivalent to invoking
274 List the files specified by arguments
276 in the order in which they appear in the archive, one per line.
277 If no files are specified, all files in the archive are listed.
279 Use only the first fifteen characters of the archive member name or
280 command line file name argument when naming archive members.
282 Conditionally update the archive or extract members.
285 option, files named by arguments
287 will be replaced in the archive if they are newer than their
291 option, the members specified by arguments
293 will be extracted only if they are newer than the corresponding
294 files in the file system.
296 Provide verbose output.
305 gives a file-by-file description of the archive modification being
306 performed, which consists of three white-space separated fields:
307 the option letter, a dash
314 displays the description as above, but the initial letter is an
316 if the file is added to the archive, or an
318 if the file replaces a file already in the archive.
321 option, the name of the file enclosed in
325 characters is written to standard output preceded by a single newline
326 character and followed by two newline characters.
327 The contents of the named file follow the file name.
332 displays eight whitespace separated fields:
333 the file permissions as displayed by
335 decimal user and group IDs separated by a slash (
337 the file size in bytes, the file modification time in
340 .Dq "%b %e %H:%M %Y" ,
341 and the name of the file.
343 Extract archive members specified by arguments
345 into the current directory.
346 If no members have been specified, extract all members of the archive.
347 If the file corresponding to an extracted member does not exist it
349 If the file corresponding to an extracted member does exist, its owner
350 and group will not be changed while its contents will be overwritten
351 and its permissions will set to that entered in the archive.
352 The file's access and modification time would be that of the time
353 of extraction unless the
355 option was specified.
357 This option is accepted but ignored.
360 To create a new archive
362 containing three files
368 .Dl "ar -rc ex.a ex1.o ex2.o ex3.o"
370 To add an archive symbol table to an existing archive
380 .D1 "ar -d ex.a ex1.o"
382 To verbosely list the contents of archive
395 .\" .Sh COMPATIBILITY
397 .\" is expected to be compatible with GNU and SVR4
400 .\" Do the POSIX/SuSv3 standards have anything to say about AR(1)?
404 command first appeared in AT&T UNIX Version 1.
407 .An "Kai Wang" Aq kaiw@FreeBSD.org