archive_write_set_options.3 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  1. .\" Copyright (c) 2003-2010 Tim Kientzle
  2. .\" All rights reserved.
  3. .\"
  4. .\" Redistribution and use in source and binary forms, with or without
  5. .\" modification, are permitted provided that the following conditions
  6. .\" are met:
  7. .\" 1. Redistributions of source code must retain the above copyright
  8. .\" notice, this list of conditions and the following disclaimer.
  9. .\" 2. Redistributions in binary form must reproduce the above copyright
  10. .\" notice, this list of conditions and the following disclaimer in the
  11. .\" documentation and/or other materials provided with the distribution.
  12. .\"
  13. .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  14. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  15. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  16. .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  17. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  18. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  19. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  20. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  21. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  22. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. .\" SUCH DAMAGE.
  24. .\"
  25. .Dd January 31, 2020
  26. .Dt ARCHIVE_WRITE_OPTIONS 3
  27. .Os
  28. .Sh NAME
  29. .Nm archive_write_set_filter_option ,
  30. .Nm archive_write_set_format_option ,
  31. .Nm archive_write_set_option ,
  32. .Nm archive_write_set_options
  33. .Nd functions controlling options for writing archives
  34. .Sh LIBRARY
  35. Streaming Archive Library (libarchive, -larchive)
  36. .Sh SYNOPSIS
  37. .Ft int
  38. .Fo archive_write_set_filter_option
  39. .Fa "struct archive *"
  40. .Fa "const char *module"
  41. .Fa "const char *option"
  42. .Fa "const char *value"
  43. .Fc
  44. .Ft int
  45. .Fo archive_write_set_format_option
  46. .Fa "struct archive *"
  47. .Fa "const char *module"
  48. .Fa "const char *option"
  49. .Fa "const char *value"
  50. .Fc
  51. .Ft int
  52. .Fo archive_write_set_option
  53. .Fa "struct archive *"
  54. .Fa "const char *module"
  55. .Fa "const char *option"
  56. .Fa "const char *value"
  57. .Fc
  58. .Ft int
  59. .Fo archive_write_set_options
  60. .Fa "struct archive *"
  61. .Fa "const char *options"
  62. .Fc
  63. .Sh DESCRIPTION
  64. These functions provide a way for libarchive clients to configure
  65. specific write modules.
  66. .Bl -tag -width indent
  67. .It Xo
  68. .Fn archive_write_set_filter_option ,
  69. .Fn archive_write_set_format_option
  70. .Xc
  71. Specifies an option that will be passed to the currently-registered
  72. filters (including decompression filters) or format readers.
  73. .Pp
  74. If
  75. .Ar option
  76. and
  77. .Ar value
  78. are both
  79. .Dv NULL ,
  80. these functions will do nothing and
  81. .Cm ARCHIVE_OK
  82. will be returned.
  83. If
  84. .Ar option
  85. is
  86. .Dv NULL
  87. but
  88. .Ar value
  89. is not, these functions will do nothing and
  90. .Cm ARCHIVE_FAILED
  91. will be returned.
  92. .Pp
  93. If
  94. .Ar module
  95. is not
  96. .Dv NULL ,
  97. .Ar option
  98. and
  99. .Ar value
  100. will be provided to the filter or reader named
  101. .Ar module .
  102. The return value will be either
  103. .Cm ARCHIVE_OK
  104. if the option was successfully handled or
  105. .Cm ARCHIVE_WARN
  106. if the option was unrecognized by the module or could otherwise
  107. not be handled.
  108. If there is no such module,
  109. .Cm ARCHIVE_FAILED
  110. will be returned.
  111. .Pp
  112. If
  113. .Ar module
  114. is
  115. .Dv NULL ,
  116. .Ar option
  117. and
  118. .Ar value
  119. will be provided to every registered module.
  120. If any module returns
  121. .Cm ARCHIVE_FATAL ,
  122. this value will be returned immediately.
  123. Otherwise,
  124. .Cm ARCHIVE_OK
  125. will be returned if any module accepts the option, and
  126. .Cm ARCHIVE_FAILED
  127. in all other cases.
  128. .\"
  129. .It Fn archive_write_set_option
  130. Calls
  131. .Fn archive_write_set_format_option ,
  132. then
  133. .Fn archive_write_set_filter_option .
  134. If either function returns
  135. .Cm ARCHIVE_FATAL ,
  136. .Cm ARCHIVE_FATAL
  137. will be returned
  138. immediately.
  139. Otherwise, the greater of the two values will be returned.
  140. .\"
  141. .It Fn archive_write_set_options
  142. .Ar options
  143. is a comma-separated list of options.
  144. If
  145. .Ar options
  146. is
  147. .Dv NULL
  148. or empty,
  149. .Cm ARCHIVE_OK
  150. will be returned immediately.
  151. .Pp
  152. Individual options have one of the following forms:
  153. .Bl -tag -compact -width indent
  154. .It Ar option=value
  155. The option/value pair will be provided to every module.
  156. Modules that do not accept an option with this name will ignore it.
  157. .It Ar option
  158. The option will be provided to every module with a value of
  159. .Dq 1 .
  160. .It Ar !option
  161. The option will be provided to every module with a NULL value.
  162. .It Ar module:option=value , Ar module:option , Ar module:!option
  163. As above, but the corresponding option and value will be provided
  164. only to modules whose name matches
  165. .Ar module .
  166. .El
  167. .El
  168. .\"
  169. .Sh OPTIONS
  170. .Bl -tag -compact -width indent
  171. .It Filter b64encode
  172. .Bl -tag -compact -width indent
  173. .It Cm mode
  174. The value is interpreted as octal digits specifying the file mode.
  175. .It Cm name
  176. The value specifies the file name.
  177. .El
  178. .It Filter bzip2
  179. .Bl -tag -compact -width indent
  180. .It Cm compression-level
  181. The value is interpreted as a decimal integer specifying the
  182. bzip2 compression level. Supported values are from 1 to 9.
  183. .El
  184. .It Filter gzip
  185. .Bl -tag -compact -width indent
  186. .It Cm compression-level
  187. The value is interpreted as a decimal integer specifying the
  188. gzip compression level. Supported values are from 0 to 9.
  189. .It Cm timestamp
  190. Store timestamp. This is enabled by default.
  191. .El
  192. .It Filter lrzip
  193. .Bl -tag -compact -width indent
  194. .It Cm compression Ns = Ns Ar type
  195. Use
  196. .Ar type
  197. as compression method.
  198. Supported values are
  199. .Dq bzip2 ,
  200. .Dq gzipi ,
  201. .Dq lzo
  202. .Pq ultra fast ,
  203. and
  204. .Dq zpaq
  205. .Pq best, extremely slow .
  206. .It Cm compression-level
  207. The value is interpreted as a decimal integer specifying the
  208. lrzip compression level. Supported values are from 1 to 9.
  209. .El
  210. .It Filter lz4
  211. .Bl -tag -compact -width indent
  212. .It Cm compression-level
  213. The value is interpreted as a decimal integer specifying the
  214. lz4 compression level. Supported values are from 0 to 9.
  215. .It Cm stream-checksum
  216. Enable stream checksum. This is enabled by default.
  217. .It Cm block-checksum
  218. Enable block checksum. This is disabled by default.
  219. .It Cm block-size
  220. The value is interpreted as a decimal integer specifying the
  221. lz4 compression block size. Supported values are from 4 to 7
  222. .Pq default .
  223. .It Cm block-dependence
  224. Use the previous block of the block being compressed for
  225. a compression dictionary to improve compression ratio.
  226. This is disabled by default.
  227. .El
  228. .It Filter lzop
  229. .Bl -tag -compact -width indent
  230. .It Cm compression-level
  231. The value is interpreted as a decimal integer specifying the
  232. lzop compression level. Supported values are from 1 to 9.
  233. .El
  234. .It Filter uuencode
  235. .Bl -tag -compact -width indent
  236. .It Cm mode
  237. The value is interpreted as octal digits specifying the file mode.
  238. .It Cm name
  239. The value specifies the file name.
  240. .El
  241. .It Filter xz
  242. .Bl -tag -compact -width indent
  243. .It Cm compression-level
  244. The value is interpreted as a decimal integer specifying the
  245. compression level. Supported values are from 0 to 9.
  246. .It Cm threads
  247. The value is interpreted as a decimal integer specifying the
  248. number of threads for multi-threaded lzma compression.
  249. If supported, the default value is read from
  250. .Fn lzma_cputhreads .
  251. .El
  252. .It Filter zstd
  253. .Bl -tag -compact -width indent
  254. .It Cm compression-level
  255. The value is interpreted as a decimal integer specifying the
  256. compression level. Supported values depend on the library version,
  257. common values are from 1 to 22.
  258. .It Cm long
  259. Enables long distance matching. The value is interpreted as a
  260. decimal integer specifying log2 window size in bytes. Values from
  261. 10 to 30 for 32 bit, or 31 for 64 bit, are supported.
  262. .It Cm threads
  263. The value is interpreted as a decimal integer specifying the
  264. number of threads for multi-threaded zstd compression.
  265. If set to 0, zstd will attempt to detect and use the number
  266. of active physical CPU cores.
  267. .El
  268. .It Format 7zip
  269. .Bl -tag -compact -width indent
  270. .It Cm compression
  271. The value is one of
  272. .Dq store ,
  273. .Dq copy ,
  274. .Dq deflate ,
  275. .Dq bzip2 ,
  276. .Dq lzma1 ,
  277. .Dq lzma2 ,
  278. .Dq ppmd ,
  279. or
  280. .Dq zstd
  281. to indicate how the following entries should be compressed.
  282. The values
  283. .Dq store
  284. and
  285. .Dq copy
  286. are synonyms.
  287. Note that this setting is ignored for directories, symbolic links,
  288. and other special entries.
  289. .It Cm compression-level
  290. The value is interpreted as a decimal integer specifying the
  291. compression level.
  292. Values between 0 and 9 are supported, with the exception of bzip2
  293. which only supports values between 1 and 9, and zstd which may
  294. support negative values depending on the library version and
  295. commonly used values 1 through 22.
  296. The interpretation of the compression level depends on the chosen
  297. compression method.
  298. .It Cm threads
  299. The value is interpreted as a decimal integer specifying the
  300. number of threads for multi-threaded compression (for compressors
  301. like zstd that support it). If set to 0, an attempt will be made
  302. to discover the number of CPU cores.
  303. .El
  304. .It Format bin
  305. .Bl -tag -compact -width indent
  306. .It Cm hdrcharset
  307. The value is used as a character set name that will be
  308. used when translating file names.
  309. .El
  310. .It Format gnutar
  311. .Bl -tag -compact -width indent
  312. .It Cm hdrcharset
  313. The value is used as a character set name that will be
  314. used when translating file, group and user names.
  315. .El
  316. .It Format iso9660 - volume metadata
  317. These options are used to set standard ISO9660 metadata.
  318. .Bl -tag -compact -width indent
  319. .It Cm abstract-file Ns = Ns Ar filename
  320. The file with the specified name will be identified in the ISO9660 metadata
  321. as holding the abstract for this volume.
  322. Default: none.
  323. .It Cm application-id Ns = Ns Ar filename
  324. The file with the specified name will be identified in the ISO9660 metadata
  325. as holding the application identifier for this volume.
  326. Default: none.
  327. .It Cm biblio-file Ns = Ns Ar filename
  328. The file with the specified name will be identified in the ISO9660 metadata
  329. as holding the bibliography for this volume.
  330. Default: none.
  331. .It Cm copyright-file Ns = Ns Ar filename
  332. The file with the specified name will be identified in the ISO9660 metadata
  333. as holding the copyright for this volume.
  334. Default: none.
  335. .It Cm publisher Ns = Ns Ar filename
  336. The file with the specified name will be identified in the ISO9660 metadata
  337. as holding the publisher information for this volume.
  338. Default: none.
  339. .It Cm volume-id Ns = Ns Ar string
  340. The specified string will be used as the Volume Identifier in the ISO9660 metadata.
  341. It is limited to 32 bytes.
  342. Default: none.
  343. .El
  344. .It Format iso9660 - boot support
  345. These options are used to make an ISO9660 image that can be directly
  346. booted on various systems.
  347. .Bl -tag -compact -width indent
  348. .It Cm boot Ns = Ns Ar filename
  349. The file matching this name will be used as the El Torito boot image file.
  350. .It Cm boot-catalog Ns = Ns Ar name
  351. The name that will be used for the El Torito boot catalog.
  352. Default:
  353. .Ar boot.catalog
  354. .It Cm boot-info-table
  355. The boot image file provided by the
  356. .Cm boot Ns = Ns Ar filename
  357. option will be edited with appropriate boot information in bytes 8 through 64.
  358. Default: disabled
  359. .It Cm boot-load-seg Ns = Ns Ar hexadecimal-number
  360. The load segment for a no-emulation boot image.
  361. .It Cm boot-load-size Ns = Ns Ar decimal-number
  362. The number of "virtual" 512-byte sectors to be loaded from a no-emulation boot image.
  363. Some very old BIOSes can only load very small images, setting this
  364. value to 4 will often allow such BIOSes to load the first part of
  365. the boot image (which will then need to be intelligent enough to
  366. load the rest of itself).
  367. This should not be needed unless you are trying to support systems with very old BIOSes.
  368. This defaults to the full size of the image.
  369. .It Cm boot-type Ns = Ns Ar value
  370. Specifies the boot semantics used by the El Torito boot image:
  371. If the
  372. .Ar value
  373. is
  374. .Cm fd ,
  375. then the boot image is assumed to be a bootable floppy image.
  376. If the
  377. .Ar value
  378. is
  379. .Cm hd ,
  380. then the boot image is assumed to be a bootable hard disk image.
  381. If the
  382. .Ar value
  383. is
  384. .Cm no-emulation ,
  385. the boot image is used without floppy or hard disk emulation.
  386. If the boot image is exactly 1.2MB, 1.44MB, or 2.88MB, then
  387. the default is
  388. .Cm fd ,
  389. otherwise the default is
  390. .Cm no-emulation .
  391. .El
  392. .It Format iso9660 - filename and size extensions
  393. Various extensions to the base ISO9660 format.
  394. .Bl -tag -compact -width indent
  395. .It Cm allow-ldots
  396. If enabled, allows filenames to begin with a leading period.
  397. If disabled, filenames that begin with a leading period will have
  398. that period replaced by an underscore character in the standard ISO9660
  399. namespace.
  400. This does not impact names stored in the Rockridge or Joliet extension area.
  401. Default: disabled.
  402. .It Cm allow-lowercase
  403. If enabled, allows filenames to contain lowercase characters.
  404. If disabled, filenames will be forced to uppercase.
  405. This does not impact names stored in the Rockridge or Joliet extension area.
  406. Default: disabled.
  407. .It Cm allow-multidot
  408. If enabled, allows filenames to contain multiple period characters, in violation of the ISO9660 specification.
  409. If disabled, additional periods will be converted to underscore characters.
  410. This does not impact names stored in the Rockridge or Joliet extension area.
  411. Default: disabled.
  412. .It Cm allow-period
  413. If enabled, allows filenames to contain trailing period characters, in violation of the ISO9660 specification.
  414. If disabled, trailing periods will be converted to underscore characters.
  415. This does not impact names stored in the Rockridge or Joliet extension area.
  416. Default: disabled.
  417. .It Cm allow-pvd-lowercase
  418. If enabled, the Primary Volume Descriptor may contain lowercase ASCII characters, in violation of the ISO9660 specification.
  419. If disabled, characters will be converted to uppercase ASCII.
  420. Default: disabled.
  421. .It Cm allow-sharp-tilde
  422. If enabled, sharp and tilde characters will be permitted in filenames, in violation if the ISO9660 specification.
  423. If disabled, such characters will be converted to underscore characters.
  424. Default: disabled.
  425. .It Cm allow-vernum
  426. If enabled, version numbers will be included with files.
  427. If disabled, version numbers will be suppressed, in violation of the ISO9660 standard.
  428. This does not impact names stored in the Rockridge or Joliet extension area.
  429. Default: enabled.
  430. .It Cm iso-level
  431. This enables support for file size and file name extensions in the
  432. core ISO9660 area.
  433. The name extensions specified here do not affect the names stored in the Rockridge or Joliet extension areas.
  434. .Bl -tag -compact -width indent
  435. .It Cm iso-level=1
  436. The most compliant form of ISO9660 image.
  437. Filenames are limited to 8.3 uppercase format,
  438. directory names are limited to 8 uppercase characters,
  439. files are limited to 4 GiB,
  440. the complete ISO9660 image cannot exceed 4 GiB.
  441. .It Cm iso-level=2
  442. Filenames are limited to 30 uppercase characters with a 30-character extension,
  443. directory names are limited to 30 characters,
  444. files are limited to 4 GiB.
  445. .It Cm iso-level=3
  446. As with
  447. .Cm iso-level=2 ,
  448. except that files may exceed 4 GiB.
  449. .It Cm iso-level=4
  450. As with
  451. .Cm iso-level=3 ,
  452. except that filenames may be up to 193 characters
  453. and may include arbitrary 8-bit characters.
  454. .El
  455. .It Cm joliet
  456. Microsoft's Joliet extensions store a completely separate set of directory information about each file.
  457. In particular, this information includes Unicode filenames of up to 255 characters.
  458. Default: enabled.
  459. .It Cm limit-depth
  460. If enabled, libarchive will use directory relocation records to ensure that
  461. no pathname exceeds the ISO9660 limit of 8 directory levels.
  462. If disabled, no relocation will occur.
  463. Default: enabled.
  464. .It Cm limit-dirs
  465. If enabled, libarchive will cause an error if there are more than
  466. 65536 directories.
  467. If disabled, there is no limit on the number of directories.
  468. Default: enabled
  469. .It Cm pad
  470. If enabled, 300 kiB of zero bytes will be appended to the end of the archive.
  471. Default: enabled
  472. .It Cm relaxed-filenames
  473. If enabled, all 7-bit ASCII characters are permitted in filenames
  474. (except lowercase characters unless
  475. .Cm allow-lowercase
  476. is also specified).
  477. This violates ISO9660 standards.
  478. This does not impact names stored in the Rockridge or Joliet extension area.
  479. Default: disabled.
  480. .It Cm rockridge
  481. The Rockridge extensions store an additional set of POSIX-style file
  482. information with each file, including mtime, atime, ctime, permissions,
  483. and long filenames with arbitrary 8-bit characters.
  484. These extensions also support symbolic links and other POSIX file types.
  485. Default: enabled.
  486. .El
  487. .It Format iso9660 - zisofs support
  488. The zisofs extensions permit each file to be independently compressed
  489. using a gzip-compatible compression.
  490. This can provide significant size savings, but requires the reading
  491. system to have support for these extensions.
  492. These extensions are disabled by default.
  493. .Bl -tag -compact -width indent
  494. .It Cm compression-level Ns = Ns number
  495. The compression level used by the deflate compressor.
  496. Ranges from 0 (least effort) to 9 (most effort).
  497. Default: 6
  498. .It Cm zisofs
  499. Synonym for
  500. .Cm zisofs=direct .
  501. .It Cm zisofs=direct
  502. Compress each file in the archive.
  503. Unlike
  504. .Cm zisofs=indirect ,
  505. this is handled entirely within libarchive and does not require a
  506. separate utility.
  507. For best results, libarchive tests each file and will store
  508. the file uncompressed if the compression does not actually save any space.
  509. In particular, files under 2k will never be compressed.
  510. Note that boot image files are never compressed.
  511. .It Cm zisofs=indirect
  512. Recognizes files that have already been compressed with the
  513. .Cm mkzftree
  514. utility and sets up the necessary file metadata so that
  515. readers will correctly identify these as zisofs-compressed files.
  516. .It Cm zisofs-exclude Ns = Ns Ar filename
  517. Specifies a filename that should not be compressed when using
  518. .Cm zisofs=direct .
  519. This option can be provided multiple times to suppress compression
  520. on many files.
  521. .El
  522. .It Format mtree
  523. .Bl -tag -compact -width indent
  524. .It Cm cksum , Cm device , Cm flags , Cm gid , Cm gname , Cm indent , Cm link , Cm md5 , Cm mode , Cm nlink , Cm rmd160 , Cm sha1 , Cm sha256 , Cm sha384 , Cm sha512 , Cm size , Cm time , Cm uid , Cm uname
  525. Enable a particular keyword in the mtree output.
  526. Prefix with an exclamation mark to disable the corresponding keyword.
  527. The default is equivalent to
  528. .Dq device, flags, gid, gname, link, mode, nlink, size, time, type, uid, uname .
  529. .It Cm all
  530. Enables all of the above keywords.
  531. .It Cm use-set
  532. Enables generation of
  533. .Cm /set
  534. lines that specify default values for the following files and/or directories.
  535. .It Cm indent
  536. XXX needs explanation XXX
  537. .El
  538. .It Format newc
  539. .Bl -tag -compact -width indent
  540. .It Cm hdrcharset
  541. The value is used as a character set name that will be
  542. used when translating file names.
  543. .El
  544. .It Format odc
  545. .Bl -tag -compact -width indent
  546. .It Cm hdrcharset
  547. The value is used as a character set name that will be
  548. used when translating file names.
  549. .El
  550. .It Format pwb
  551. .Bl -tag -compact -width indent
  552. .It Cm hdrcharset
  553. The value is used as a character set name that will be
  554. used when translating file names.
  555. .El
  556. .It Format pax
  557. .Bl -tag -compact -width indent
  558. .It Cm hdrcharset
  559. The value is used as a character set name that will be
  560. used when translating file, group and user names.
  561. The value is one of
  562. .Dq BINARY
  563. or
  564. .Dq UTF-8 .
  565. With
  566. .Dq BINARY
  567. there is no character conversion, with
  568. .Dq UTF-8
  569. names are converted to UTF-8.
  570. .It Cm xattrheader
  571. When storing extended attributes, this option configures which
  572. headers should be written. The value is one of
  573. .Dq all ,
  574. .Dq LIBARCHIVE ,
  575. or
  576. .Dq SCHILY .
  577. By default, both
  578. .Dq LIBARCHIVE.xattr
  579. and
  580. .Dq SCHILY.xattr
  581. headers are written.
  582. .El
  583. .It Format ustar
  584. .Bl -tag -compact -width indent
  585. .It Cm hdrcharset
  586. The value is used as a character set name that will be
  587. used when translating file, group and user names.
  588. .El
  589. .It Format v7tar
  590. .Bl -tag -compact -width indent
  591. .It Cm hdrcharset
  592. The value is used as a character set name that will be
  593. used when translating file, group and user names.
  594. .El
  595. .It Format warc
  596. .Bl -tag -compact -width indent
  597. .It Cm omit-warcinfo
  598. Set to
  599. .Dq true
  600. to disable output of the warcinfo record.
  601. .El
  602. .It Format xar
  603. .Bl -tag -compact -width indent
  604. .It Cm checksum Ns = Ns Ar type
  605. Use
  606. .Ar type
  607. as file checksum method.
  608. Supported values are
  609. .Dq none ,
  610. .Dq md5 ,
  611. and
  612. .Dq sha1
  613. .Pq default .
  614. .It Cm compression Ns = Ns Ar type
  615. Use
  616. .Ar type
  617. as compression method.
  618. Supported values are
  619. .Dq none ,
  620. .Dq bzip2 ,
  621. .Dq gzip
  622. .Pq default ,
  623. .Dq lzma
  624. and
  625. .Dq xz .
  626. .It Cm compression_level
  627. The value is a decimal integer from 1 to 9 specifying the compression level.
  628. .It Cm toc-checksum Ns = Ns Ar type
  629. Use
  630. .Ar type
  631. as table of contents checksum method.
  632. Supported values are
  633. .Dq none ,
  634. .Dq md5
  635. and
  636. .Dq sha1
  637. .Pq default .
  638. .El
  639. .It Format zip
  640. .Bl -tag -compact -width indent
  641. .It Cm compression
  642. The value is either
  643. .Dq store ,
  644. .Dq deflate ,
  645. .Dq bzip2 ,
  646. .Dq lzma ,
  647. .Dq xz ,
  648. or
  649. .Dq zstd
  650. to indicate how the following entries should be compressed.
  651. Note that this setting is ignored for directories, symbolic links,
  652. and other special entries.
  653. .It Cm compression-level
  654. The value is interpreted as a decimal integer specifying the
  655. compression level.
  656. Values between 0 and 9 are supported.
  657. A compression level of 0 switches the compression method to
  658. .Dq store ,
  659. other values will enable
  660. .Dq deflate ,
  661. .Dq bzip2 ,
  662. .Dq lzma ,
  663. or
  664. .Dq zstd
  665. compression (in order of priority, depending on what libraries
  666. are linked) with the given level.
  667. .It Cm threads
  668. The value is interpreted as a decimal integer specifying the
  669. number of threads to use for compression.
  670. It is supported only for
  671. .Dq xz
  672. or
  673. .Dq zstd
  674. compression and ignored for any other.
  675. A threads value of 0 is a special one requesting to detect and use as
  676. many threads as the number of active physical CPU cores.
  677. .It Cm encryption
  678. Enable encryption using traditional zip encryption.
  679. .It Cm encryption Ns = Ns Ar type
  680. Use
  681. .Ar type
  682. as encryption type.
  683. Supported values are
  684. .Dq zipcrypt
  685. .Pq traditional zip encryption ,
  686. .Dq aes128
  687. .Pq WinZip AES-128 encryption
  688. and
  689. .Dq aes256
  690. .Pq WinZip AES-256 encryption .
  691. .It Cm experimental
  692. This boolean option enables or disables experimental Zip features
  693. that may not be compatible with other Zip implementations.
  694. .It Cm fakecrc32
  695. This boolean option disables CRC calculations.
  696. All CRC fields are set to zero.
  697. It should not be used except for testing purposes.
  698. .It Cm hdrcharset
  699. The value is used as a character set name that will be
  700. used when translating file names.
  701. .It Cm zip64
  702. Zip64 extensions provide additional file size information
  703. for entries larger than 4 GiB.
  704. They also provide extended file offset and archive size information
  705. when archives exceed 4 GiB.
  706. By default, the Zip writer selectively enables these extensions only as needed.
  707. In particular, if the file size is unknown, the Zip writer will
  708. include Zip64 extensions to guard against the possibility that the
  709. file might be larger than 4 GiB.
  710. .Pp
  711. Setting this boolean option will force the writer to use Zip64 extensions
  712. even for small files that would not otherwise require them.
  713. This is primarily useful for testing.
  714. .Pp
  715. Disabling this option with
  716. .Cm !zip64
  717. will force the Zip writer to avoid Zip64 extensions:
  718. It will reject files with size greater than 4 GiB,
  719. it will reject any new entries once the total archive size reaches 4 GiB,
  720. and it will not use Zip64 extensions for files with unknown size.
  721. In particular, this can improve compatibility when generating archives
  722. where the entry sizes are not known in advance.
  723. .El
  724. .El
  725. .Sh EXAMPLES
  726. The following example creates an archive write handle to
  727. create a gzip-compressed ISO9660 format image.
  728. The two options here specify that the ISO9660 archive will use
  729. .Ar kernel.img
  730. as the boot image for El Torito booting, and that the gzip
  731. compressor should use the maximum compression level.
  732. .Bd -literal -offset indent
  733. a = archive_write_new();
  734. archive_write_add_filter_gzip(a);
  735. archive_write_set_format_iso9660(a);
  736. archive_write_set_options(a, "boot=kernel.img,compression=9");
  737. archive_write_open_filename(a, filename, blocksize);
  738. .Ed
  739. .\"
  740. .Sh ERRORS
  741. More detailed error codes and textual descriptions are available from the
  742. .Fn archive_errno
  743. and
  744. .Fn archive_error_string
  745. functions.
  746. .\"
  747. .Sh SEE ALSO
  748. .Xr tar 1 ,
  749. .Xr archive_read_set_options 3 ,
  750. .Xr archive_write 3 ,
  751. .Xr libarchive 3
  752. .Sh HISTORY
  753. The
  754. .Nm libarchive
  755. library first appeared in
  756. .Fx 5.3 .
  757. .Sh AUTHORS
  758. .An -nosplit
  759. The options support for libarchive was originally implemented by
  760. .An Michihiro NAKAJIMA .
  761. .Sh BUGS