Print this page
4023 - Typo in file(1) manpage and various others
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1/ar.1
+++ new/usr/src/man/man1/ar.1
1 1 '\" te
2 2 .\" Copyright 1989 AT&T
↓ open down ↓ |
2 lines elided |
↑ open up ↑ |
3 3 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
4 4 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
5 5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/.
6 6 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text
7 7 .\" are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical
8 8 .\" and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
9 9 .\" This notice shall appear on any product containing this material.
10 10 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
11 11 .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
12 12 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
13 -.TH AR 1 "Aug 24, 2009"
13 +.TH AR 1 "Sep 10, 2013"
14 14 .SH NAME
15 15 ar \- maintain portable archive or library
16 16 .SH SYNOPSIS
17 17 .LP
18 18 .nf
19 19 \fB/usr/bin/ar\fR \fB-d\fR [\fB-Vv\fR] \fIarchive\fR \fIfile\fR...
20 20 .fi
21 21
22 22 .LP
23 23 .nf
24 24 \fB/usr/bin/ar\fR \fB-m\fR [\fB-abiVv\fR] [\fIposname\fR] \fIarchive\fR \fIfile\fR...
25 25 .fi
26 26
27 27 .LP
28 28 .nf
29 29 \fB/usr/bin/ar\fR \fB-p\fR [\fB-sVv\fR] \fIarchive\fR [\fIfile\fR]...
30 30 .fi
31 31
32 32 .LP
33 33 .nf
34 34 \fB/usr/bin/ar\fR \fB-q\fR [\fB-cVv\fR] \fIarchive\fR \fIfile\fR...
35 35 .fi
36 36
37 37 .LP
38 38 .nf
39 39 \fB/usr/bin/ar\fR \fB-r\fR [\fB-abciuVv\fR] [\fIposname\fR] \fIarchive\fR \fIfile\fR...
40 40 .fi
41 41
42 42 .LP
43 43 .nf
44 44 \fB/usr/bin/ar\fR \fB-t\fR [\fB-sVv\fR] \fIarchive\fR [\fIfile\fR]...
45 45 .fi
46 46
47 47 .LP
48 48 .nf
49 49 \fB/usr/bin/ar\fR \fB-x\fR [\fB-CsTVv\fR] \fIarchive\fR [\fIfile\fR]...
50 50 .fi
51 51
52 52 .LP
53 53 .nf
54 54 \fB/usr/xpg4/bin/ar\fR \fB-d\fR [\fB-Vv\fR] \fIarchive\fR \fIfile\fR...
55 55 .fi
56 56
57 57 .LP
58 58 .nf
59 59 \fB/usr/xpg4/bin/ar\fR \fB-m\fR [\fB-abiVv\fR] [\fIposname\fR] \fIarchive\fR \fIfile\fR...
60 60 .fi
61 61
62 62 .LP
63 63 .nf
64 64 \fB/usr/xpg4/bin/ar\fR \fB-p\fR [\fB-sVv\fR] \fIarchive\fR [\fIfile\fR]...
65 65 .fi
66 66
67 67 .LP
68 68 .nf
69 69 \fB/usr/xpg4/bin/ar\fR \fB-q\fR [\fB-cVv\fR] \fIarchive\fR \fIfile\fR...
70 70 .fi
71 71
72 72 .LP
73 73 .nf
74 74 \fB/usr/xpg4/bin/ar\fR \fB-r\fR [\fB-abciuVv\fR] [\fIposname\fR] \fIarchive\fR \fIfile\fR...
75 75 .fi
76 76
77 77 .LP
78 78 .nf
79 79 \fB/usr/xpg4/bin/ar\fR \fB-t\fR [\fB-sVv\fR] \fIarchive\fR [\fIfile\fR]...
80 80 .fi
81 81
82 82 .LP
83 83 .nf
84 84 \fB/usr/xpg4/bin/ar\fR \fB-x\fR [\fB-CsTVv\fR] \fIarchive\fR [\fIfile\fR]...
85 85 .fi
86 86
87 87 .SH DESCRIPTION
88 88 .sp
89 89 .LP
90 90 The \fBar\fR utility maintains groups of files combined into a single archive
91 91 file. Its main use is to create and update library files. However, it can be
92 92 used for any similar purpose. The magic string and the file headers used by
93 93 \fBar\fR consist of printable \fBASCII\fR characters. If an archive is composed
94 94 of printable files, the entire archive is printable.
95 95 .sp
96 96 .LP
97 97 When \fBar\fR creates an archive, it creates headers in a format that is
98 98 portable across all machines. The portable archive format and structure are
99 99 described in detail in \fBar.h\fR(3HEAD). The archive symbol table described
100 100 there is used by the link editor \fBld\fR(1) to effect multiple passes over
101 101 libraries of object files in an efficient manner. An archive symbol table is
102 102 only created and maintained by \fBar\fR when there is at least one object file
103 103 in the archive. The archive symbol table is in a specially named file that is
104 104 always the first file in the archive. This file is never mentioned or
105 105 accessible to the user. Whenever the \fBar\fR command is used to create or
106 106 update the contents of such an archive, the symbol table is rebuilt. The
107 107 \fB-s\fR option described below forces the symbol table to be rebuilt.
108 108 .SH OPTIONS
109 109 .sp
110 110 .LP
111 111 The following options are supported:
112 112 .sp
113 113 .ne 2
114 114 .na
115 115 \fB\fB-a\fR\fR
116 116 .ad
117 117 .RS 6n
118 118 Positions new \fIfile\fRs in \fIarchive\fR after the file named by the
119 119 \fIposname\fR operand.
120 120 .RE
121 121
122 122 .sp
123 123 .ne 2
124 124 .na
125 125 \fB\fB-b\fR\fR
126 126 .ad
127 127 .RS 6n
128 128 Positions new \fIfile\fRs in \fIarchive\fR before the file named by the
129 129 \fIposname\fR operand.
130 130 .RE
131 131
132 132 .sp
133 133 .ne 2
134 134 .na
135 135 \fB\fB-c\fR\fR
136 136 .ad
137 137 .RS 6n
138 138 Suppresses the diagnostic message that is written to standard error by default
139 139 when \fIarchive\fR is created.
140 140 .RE
141 141
142 142 .sp
143 143 .ne 2
144 144 .na
145 145 \fB\fB-C\fR\fR
146 146 .ad
147 147 .RS 6n
148 148 Prevents extracted files from replacing like-named files in the file system.
149 149 This option is useful when \fB-T\fR is also used to prevent truncated file
150 150 names from replacing files with the same prefix.
151 151 .RE
152 152
153 153 .sp
154 154 .ne 2
155 155 .na
156 156 \fB\fB-d\fR\fR
157 157 .ad
158 158 .RS 6n
159 159 Deletes one or more \fIfile\fRs from \fIarchive\fR.
160 160 .RE
161 161
162 162 .sp
163 163 .ne 2
164 164 .na
165 165 \fB\fB-i\fR\fR
166 166 .ad
167 167 .RS 6n
168 168 Positions new \fIfile\fRs in \fIarchive\fR before the file named by the
169 169 \fIposname\fR operand. This option is quivalent to \fB-b\fR.
170 170 .RE
171 171
172 172 .sp
173 173 .ne 2
174 174 .na
175 175 \fB\fB-m\fR\fR
176 176 .ad
177 177 .RS 6n
178 178 Moves \fIfile\fRs. If \fB-a\fR, \fB-b\fR, or \fB-i\fR with the \fIposname\fR
179 179 operand are specified, the \fB-m\fR option moves \fIfile\fRs to the new
180 180 position. Otherwise, \fB-m\fR moves \fIfile\fRs to the end of \fIarchive\fR.
181 181 .RE
182 182
183 183 .sp
184 184 .ne 2
185 185 .na
186 186 \fB\fB-p\fR\fR
187 187 .ad
188 188 .RS 6n
189 189 Prints the contents of \fIfile\fRs in \fIarchive\fR to standard output. If no
190 190 \fIfile\fRs are specified, the contents of all files in \fIarchive\fR are
191 191 written in the order of the archive.
192 192 .RE
193 193
194 194 .sp
195 195 .ne 2
196 196 .na
197 197 \fB\fB-q\fR\fR
198 198 .ad
199 199 .RS 6n
200 200 Quickly appends \fIfile\fRs to the end of \fIarchive\fR. Positioning options
201 201 \fB-a\fR, \fB-b\fR, and \fB-i\fR are invalid. The command does not check
202 202 whether the added \fIfile\fRs are already in \fIarchive\fR. This option is
203 203 useful to avoid quadratic behavior when creating a large archive
204 204 piece-by-piece.
205 205 .RE
206 206
207 207 .sp
208 208 .ne 2
209 209 .na
210 210 \fB\fB-r\fR\fR
211 211 .ad
212 212 .RS 6n
213 213 Replaces or adds \fIfile\fRs in \fIarchive\fR. If \fIarchive\fR does not exist,
214 214 a new archive file is created and a diagnostic message is written to standard
215 215 error, unless the \fB-c\fR option is specified. If no \fIfile\fRs are specified
216 216 and the \fIarchive\fR exists, the results are undefined. Files that replace
217 217 existing files do not change the order of the archive. If the \fB-u\fR option
218 218 is used with the \fB-r\fR option, only those files with dates of modification
219 219 later than the archive files are replaced. If the \fB-a\fR, \fB-b\fR, or
220 220 \fB-i\fR option is used, the \fIposname\fR argument must be present and
221 221 specifies that new files are to be placed after (\fB-a\fR) or before (\fB-b\fR
222 222 or \fB-i\fR) \fIposname\fR. Otherwise, the new files are placed at the end.
223 223 .RE
224 224
225 225 .sp
226 226 .ne 2
227 227 .na
228 228 \fB\fB-s\fR\fR
229 229 .ad
230 230 .RS 6n
231 231 Forces the regeneration of the archive symbol table even if \fBar\fR is not
232 232 invoked with an option that will modify the archive contents. This command is
233 233 useful to restore the archive symbol table after the \fBstrip\fR(1) command has
234 234 been used on the archive.
235 235 .RE
236 236
237 237 .sp
238 238 .ne 2
239 239 .na
240 240 \fB\fB-t\fR\fR
241 241 .ad
242 242 .RS 6n
243 243 Prints a table of contents of \fIarchive\fR. The files specified by the
244 244 \fIfile\fR operands are included in the written list. If no \fIfile\fR operands
245 245 are specified, all files in \fIarchive\fR are included in the order of the
246 246 archive.
247 247 .RE
248 248
249 249 .sp
250 250 .ne 2
251 251 .na
252 252 \fB\fB-T\fR\fR
253 253 .ad
254 254 .RS 6n
255 255 Allows file name truncation of extracted files whose archive names are longer
256 256 than the file system can support. By default, extracting a file with a name
257 257 that is too long is an error. In that case, a diagnostic message is written and
258 258 the file is not extracted.
259 259 .RE
260 260
261 261 .sp
262 262 .ne 2
263 263 .na
264 264 \fB\fB-u\fR\fR
265 265 .ad
266 266 .RS 6n
267 267 Updates older files. When used with the \fB-r\fR option, files within
268 268 \fIarchive\fR are replaced only if the corresponding \fIfile\fR has a
269 269 modification time that is at least as new as the modification time of the file
270 270 within \fIarchive\fR.
271 271 .RE
272 272
273 273 .sp
274 274 .ne 2
275 275 .na
276 276 \fB\fB-v\fR\fR
277 277 .ad
278 278 .RS 6n
279 279 Gives verbose output. When used with options \fB-d\fR, \fB-r\fR, or \fB-x\fR,
280 280 the \fB-v\fR option writes a detailed file-by-file description of the archive
281 281 creation and the constituent \fIfile\fRs, and maintenance activity. When used
282 282 with \fB-p\fR, \fB-v\fR writes the name of the file to the standard output
283 283 before writing the file itself to the standard output. When used with \fB-t\fR,
284 284 \fB-v\fR includes a long listing of information about the files within the
285 285 archive. When used with \fB-x\fR, \fB-v\fR prints the filename preceding each
286 286 extraction. When writing to an archive, \fB-v\fR writes a message to the
287 287 standard error.
288 288 .RE
289 289
290 290 .sp
291 291 .ne 2
292 292 .na
293 293 \fB\fB-V\fR\fR
294 294 .ad
295 295 .RS 6n
296 296 Prints its version number on standard error.
297 297 .RE
298 298
299 299 .SS "\fB/usr/xpg4/bin/ar\fR"
300 300 .sp
301 301 .LP
302 302 The following options are supported for \fB/usr/xpg4/bin/ar\fR:
303 303 .sp
304 304 .ne 2
305 305 .na
306 306 \fB\fB-v\fR\fR
307 307 .ad
308 308 .RS 6n
309 309 Same as the \fB/usr/bin/ar\fR version, except when writing to an archive, no
310 310 message is written to the standard error.
311 311 .RE
312 312
313 313 .sp
314 314 .ne 2
315 315 .na
316 316 \fB\fB-x\fR\fR
317 317 .ad
318 318 .RS 6n
319 319 Extracts the files named by the \fIfile\fR operands from \fIarchive\fR. The
320 320 contents of \fIarchive\fR are not changed. If no \fIfile\fR operands are given,
321 321 all files in \fIarchive\fR are extracted. If the file name of a file extracted
322 322 from \fIarchive\fR is longer than that supported in the directory to which it
323 323 is being extracted, the results are undefined. The modification time of each
324 324 \fIfile\fR extracted is set to the time \fIfile\fR is extracted from
325 325 \fIarchive\fR.
326 326 .RE
327 327
328 328 .SH OPERANDS
329 329 .sp
330 330 .LP
331 331 The following operands are supported:
332 332 .sp
333 333 .ne 2
334 334 .na
335 335 \fB\fIarchive\fR\fR
336 336 .ad
337 337 .RS 11n
338 338 A path name of the archive file.
339 339 .RE
340 340
341 341 .sp
342 342 .ne 2
343 343 .na
344 344 \fB\fIfile\fR\fR
345 345 .ad
346 346 .RS 11n
347 347 A path name. Only the last component is used when comparing against the names
348 348 of files in the archive. If two or more \fIfile\fR operands have the same last
349 349 path name component (see \fBbasename\fR(1)), the results are unspecified. The
350 350 implementation's archive format will not truncate valid file names of files
351 351 added to or replaced in the archive.
352 352 .RE
353 353
354 354 .sp
355 355 .ne 2
356 356 .na
357 357 \fB\fIposname\fR\fR
358 358 .ad
359 359 .RS 11n
360 360 The name of a file in the archive file, used for relative positioning. See
361 361 options \fB-m\fR and \fB-r\fR.
362 362 .RE
363 363
364 364 .SH ENVIRONMENT VARIABLES
365 365 .sp
366 366 .LP
367 367 See \fBenviron\fR(5) for descriptions of the following environment variables
368 368 that affect the execution of \fBar\fR: \fBLANG\fR, \fBLC_ALL\fR,
369 369 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_TIME\fR, and \fBNLSPATH\fR.
370 370 .sp
371 371 .ne 2
372 372 .na
373 373 \fB\fBTMPDIR\fR\fR
374 374 .ad
375 375 .RS 10n
376 376 Determine the pathname that overrides the default directory for temporary
377 377 files, if any.
378 378 .RE
379 379
380 380 .sp
381 381 .ne 2
382 382 .na
383 383 \fB\fBTZ\fR\fR
384 384 .ad
385 385 .RS 10n
386 386 Determine the timezone used to calculate date and time strings written by
387 387 \fBar\fR \fB-tv\fR. If \fBTZ\fR is unset or null, an unspecified default
388 388 timezone is used.
389 389 .RE
390 390
391 391 .SH EXIT STATUS
392 392 .sp
393 393 .LP
394 394 The following exit values are returned:
395 395 .sp
396 396 .ne 2
397 397 .na
398 398 \fB\fB0\fR\fR
399 399 .ad
400 400 .RS 6n
401 401 Successful completion.
402 402 .RE
403 403
404 404 .sp
405 405 .ne 2
406 406 .na
407 407 \fB\fB>0\fR\fR
408 408 .ad
409 409 .RS 6n
410 410 An error occurred.
411 411 .RE
412 412
413 413 .SH ATTRIBUTES
414 414 .sp
415 415 .LP
416 416 See \fBattributes\fR(5) for descriptions of the following attributes:
417 417 .SS "\fB/usr/bin/ar\fR"
418 418 .sp
419 419
420 420 .sp
421 421 .TS
422 422 box;
423 423 c | c
424 424 l | l .
425 425 ATTRIBUTE TYPE ATTRIBUTE VALUE
426 426 _
427 427 Interface Stability Committed
428 428 .TE
429 429
430 430 .SS "\fB/usr/xpg4/bin/ar\fR"
431 431 .sp
432 432
433 433 .sp
434 434 .TS
435 435 box;
436 436 c | c
437 437 l | l .
438 438 ATTRIBUTE TYPE ATTRIBUTE VALUE
439 439 _
440 440 Interface Stability Committed
441 441 _
442 442 Standard See \fBstandards\fR(5).
443 443 .TE
444 444
445 445 .SH SEE ALSO
446 446 .sp
447 447 .LP
448 448 \fBbasename\fR(1), \fBcpio\fR(1), \fBld\fR(1), \fBlorder\fR(1), \fBstrip\fR(1),
449 449 \fBtar\fR(1), \fBar.h\fR(3HEAD), \fBa.out\fR(4), \fBattributes\fR(5),
450 450 \fBenviron\fR(5), \fBstandards\fR(5)
451 451 .SH NOTES
↓ open down ↓ |
428 lines elided |
↑ open up ↑ |
452 452 .sp
453 453 .LP
454 454 If the same file is mentioned twice in an argument list, it may be put in the
455 455 archive twice.
456 456 .sp
457 457 .LP
458 458 By convention, archives are suffixed with "\fB\&.a\fR".
459 459 .sp
460 460 .LP
461 461 When inserting \fBELF\fR objects into an archive file, \fBar\fR might add
462 -"\fB\n\fR" characters to pad these objects to an 8-byte boundary. Such padding
462 +"\fB\en\fR" characters to pad these objects to an 8-byte boundary. Such padding
463 463 improves the efficiency with which \fBld\fR(1) can access the archive. Only
464 464 \fBELF\fR object files are padded in this way. Other archive members are not
465 465 altered. When an object with such padding is extracted from an archive, the
466 466 padding is not included in the resulting output.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX