1
0

ar 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. .TH AR 1
  2. .SH NAME
  3. ar \- archive and library maintainer
  4. .SH SYNOPSIS
  5. .B ar
  6. .I key
  7. [
  8. .I posname
  9. ]
  10. .I afile
  11. [
  12. .I file ...
  13. ]
  14. .SH DESCRIPTION
  15. .I Ar
  16. maintains groups of files
  17. combined into a single archive file,
  18. .IR afile .
  19. try this out
  20. The main use of
  21. .I ar
  22. is to create and update library files for the loaders
  23. .IR 2l (1),
  24. etc.
  25. It can be used, though, for any similar purpose.
  26. .PP
  27. .I Key
  28. is one character from the set
  29. .BR drqtpmx ,
  30. optionally concatenated with
  31. one or more of
  32. .BR vuaibclo .
  33. The
  34. .I files
  35. are constituents of the archive
  36. .IR afile .
  37. The meanings of the
  38. .I key
  39. characters are:
  40. .TP
  41. .B d
  42. Delete
  43. .I files
  44. from the archive file.
  45. .TP
  46. .B r
  47. Replace
  48. .I files
  49. in the archive file, or add them if missing.
  50. Optional modifiers are
  51. .RS
  52. .PD0
  53. .TP
  54. .B u
  55. Replace only files with
  56. modified dates later than that of
  57. the archive.
  58. .TP
  59. .B a
  60. Place new files after
  61. .I posname
  62. in the archive rather than at the end.
  63. .TP
  64. .BR b " or " i
  65. Place new files before
  66. .I posname
  67. in the archive.
  68. .RE
  69. .PD
  70. .TP
  71. .B q
  72. Quick. Append
  73. .I files
  74. to the end of the archive without checking for duplicates.
  75. Avoids quadratic behavior in
  76. .LR "for (i in *.v) ar r lib.a $i" .
  77. .TP
  78. .B t
  79. List a table of contents of the archive.
  80. If names are given, only those files are listed.
  81. .TP
  82. .B p
  83. Print the named files in the archive.
  84. .TP
  85. .B m
  86. Move the named files to the end or elsewhere,
  87. specified as with
  88. .LR r .
  89. .TP
  90. .B o
  91. Preserve the access and modification times of files
  92. extracted with the
  93. .B x
  94. command.
  95. .TP
  96. .B x
  97. Extract the named files.
  98. If no names are given, all files in the archive are
  99. extracted.
  100. In neither case does
  101. .B x
  102. alter the archive file.
  103. .TP
  104. .B v
  105. Verbose.
  106. Give a file-by-file
  107. description of the making of a
  108. new archive file from the old archive and the constituent files.
  109. With
  110. .BR p ,
  111. precede each file with a name.
  112. With
  113. .BR t ,
  114. give a long listing of all information about the files,
  115. somewhat like a listing by
  116. .IR ls (1),
  117. showing
  118. .br
  119. .ns
  120. .IP
  121. .B
  122. mode uid/gid size date name
  123. .TP
  124. .B c
  125. Create.
  126. Normally
  127. .I ar
  128. will create a new archive when
  129. .I afile
  130. does not exist, and give a warning.
  131. Option
  132. .B c
  133. discards any old contents and suppresses the warning.
  134. .TP
  135. .B l
  136. Local.
  137. Normally
  138. .I ar
  139. places its temporary files in the directory
  140. .BR /tmp .
  141. This option causes them to be placed in the local directory.
  142. .PP
  143. When a
  144. .BR d ,
  145. .BR r ,
  146. or
  147. .BR m
  148. .I key
  149. is specified and all members of the archive are valid object files for
  150. the same architecture,
  151. .I ar
  152. inserts a table of contents, required by the loaders, at
  153. the front of the library.
  154. The table of contents is
  155. rebuilt whenever the archive is modified, except
  156. when the
  157. .B q
  158. .I key
  159. is specified or when the table of contents is
  160. explicitly moved or deleted.
  161. .SH EXAMPLE
  162. .TP
  163. .L
  164. ar cr lib.a *.v
  165. Replace the contents of library
  166. .L lib.a
  167. with the object files in the current directory.
  168. .SH FILES
  169. .TF /tmp/vxxxx
  170. .TP
  171. .B /tmp/v*
  172. temporaries
  173. .SH SOURCE
  174. .B /sys/src/cmd/ar.c
  175. .SH "SEE ALSO"
  176. .IR 2l (1),
  177. .IR ar (6)
  178. .SH BUGS
  179. If the same file is mentioned twice in an argument list,
  180. it may be put in the archive twice.
  181. .br
  182. This command predates Plan 9 and makes some invalid assumptions,
  183. for instance that user id's are numeric.