f9ed600ffef2f875e94900b2e8386a6fa91f4165
[platform/upstream/libarchive.git] / doc / wiki / ManPageArchiveWriteSetOptions3.wiki
1 ARCHIVE_WRITE_OPTIONS(3) manual page 
2 == NAME == 
3 '''archive_write_set_filter_option''', 
4 '''archive_write_set_format_option''', 
5 '''archive_write_set_option''', 
6 '''archive_write_set_options''' 
7 - functions controlling options for reading archives 
8 == LIBRARY == 
9 Streaming Archive Library (libarchive, -larchive) 
10 == SYNOPSIS == 
11 <br> 
12 ''int'' 
13 <br> 
14 '''archive_write_set_filter_option'''(''struct archive *'', ''const char *module'', ''const char *option'', ''const char *value''); 
15 <br> 
16 ''int'' 
17 <br> 
18 '''archive_write_set_format_option'''(''struct archive *'', ''const char *module'', ''const char *option'', ''const char *value''); 
19 <br> 
20 ''int'' 
21 <br> 
22 '''archive_write_set_option'''(''struct archive *'', ''const char *module'', ''const char *option'', ''const char *value''); 
23 <br> 
24 ''int'' 
25 <br> 
26 '''archive_write_set_options'''(''struct archive *'', ''const char *options''); 
27 == DESCRIPTION == 
28 These functions provide a way for libarchive clients to configure 
29 specific write modules. 
30 <dl> 
31 <dt> 
32 '''archive_write_set_filter_option'''(), 
33 '''archive_write_set_format_option'''() 
34 </dt> <dd> 
35 Specifies an option that will be passed to currently-registered 
36 filters (including decompression filters) or format readers. 
37
38 If 
39 ''option'' 
40 and 
41 ''value'' 
42 are both 
43 NULL, 
44 these functions will do nothing and 
45 '''ARCHIVE_OK''' 
46 will be returned. 
47 If 
48 ''option'' 
49 is 
50 NULL 
51 but 
52 ''value'' 
53 is not, these functions will do nothing and 
54 '''ARCHIVE_FAILED''' 
55 will be returned. 
56
57 If 
58 ''module'' 
59 is not 
60 NULL, 
61 ''option'' 
62 and 
63 ''value'' 
64 will be provided to the filter or reader named 
65 ''module''. 
66 The return value will be either 
67 '''ARCHIVE_OK''' 
68 if the option was successfully handled or 
69 '''ARCHIVE_WARN''' 
70 if the option was unrecognized by the module or could otherwise 
71 not be handled. 
72 If there is no such module, 
73 '''ARCHIVE_FAILED''' 
74 will be returned. 
75
76 If 
77 ''module'' 
78 is 
79 NULL, 
80 ''option'' 
81 and 
82 ''value'' 
83 will be provided to every registered module. 
84 If any module returns 
85 '''ARCHIVE_FATAL''', 
86 this value will be returned immediately. 
87 Otherwise, 
88 '''ARCHIVE_OK''' 
89 will be returned if any module accepts the option, and 
90 '''ARCHIVE_FAILED''' 
91 in all other cases. 
92 </dd><dt>'''archive_write_set_option'''()</dt><dd> 
93 Calls 
94 '''archive_write_set_format_option'''(), 
95 then 
96 '''archive_write_set_filter_option'''(). 
97 If either function returns 
98 '''ARCHIVE_FATAL''', 
99 '''ARCHIVE_FATAL''' 
100 will be returned 
101 immediately. 
102 Otherwise, greater of the two values will be returned. 
103 </dd><dt>'''archive_write_set_options'''()</dt><dd> 
104 ''options'' 
105 is a comma-separated list of options. 
106 If 
107 ''options'' 
108 is 
109 NULL 
110 or empty, 
111 '''ARCHIVE_OK''' 
112 will be returned immediately. 
113
114 Individual options have one of the following forms: 
115 <dl> 
116 <dt>''option=value''</dt><dd> 
117 The option/value pair will be provided to every module. 
118 Modules that do not accept an option with this name will ignore it. 
119 </dd><dt>''option''</dt><dd> 
120 The option will be provided to every module with a value of 
121 "1". 
122 </dd><dt>''!option''</dt><dd> 
123 The option will be provided to every module with a NULL value. 
124 </dd><dt>''module:option=value'', ''module:option'', ''module:!option''</dt><dd> 
125 As above, but the corresponding option and value will be provided 
126 only to modules whose name matches 
127 ''module''. 
128 </dd></dl> 
129 </dd></dl> 
130 == OPTIONS == 
131 <dl> 
132 <dt>Filter gzip</dt><dd> 
133 <dl> 
134 <dt>'''compression-level'''</dt><dd> 
135 The value is interpreted as a decimal integer specifying the 
136 gzip compression level. 
137 </dd></dl> 
138 </dd><dt>Filter xz</dt><dd> 
139 <dl> 
140 <dt>'''compression-level'''</dt><dd> 
141 The value is interpreted as a decimal integer specifying the 
142 compression level. 
143 </dd></dl> 
144 </dd><dt>Format mtree</dt><dd> 
145 <dl> 
146 <dt>'''cksum''', '''device''', '''flags''', '''gid''', '''gname''', '''indent''', '''link''', '''md5''', '''mode''', '''nlink''', '''rmd160''', '''sha1''', '''sha256''', '''sha384''', '''sha512''', '''size''', '''time''', '''uid''', '''uname'''</dt><dd> 
147 Enable a particular keyword in the mtree output. 
148 Prefix with an exclamation mark to disable the corresponding keyword. 
149 The default is equivalent to 
150 "device, flags, gid, gname, link, mode, nlink, size, time, type, uid, uname". 
151 </dd><dt>'''all'''</dt><dd> 
152 Enables all of the above keywords. 
153 </dd><dt>'''use-set'''</dt><dd> 
154 Enables generation of 
155 '''/set''' 
156 lines that specify default values for the following files and/or directories. 
157 </dd><dt>'''indent'''</dt><dd> 
158 XXX needs explanation XXX 
159 </dd></dl> 
160 </dd><dt>Format iso9660 - volume metadata</dt><dd> 
161 These options are used to set standard ISO9660 metadata. 
162 <dl> 
163 <dt>'''abstract-file'''=''filename''</dt><dd> 
164 The file with the specified name will be identified in the ISO9660 metadata 
165 as holding the abstract for this volume.  Default: none. 
166 </dd><dt>'''application-id'''=''filename''</dt><dd> 
167 The file with the specified name will be identified in the ISO9660 metadata 
168 as holding the application identifier for this volume.  Default: none. 
169 </dd><dt>'''biblio-file'''=''filename''</dt><dd> 
170 The file with the specified name will be identified in the ISO9660 metadata 
171 as holding the bibliography for this volume.  Default: none. 
172 </dd><dt>'''copyright-file'''=''filename''</dt><dd> 
173 The file with the specified name will be identified in the ISO9660 metadata 
174 as holding the copyright for this volume.  Default: none. 
175 </dd><dt>'''publisher'''=''filename''</dt><dd> 
176 The file with the specified name will be identified in the ISO9660 metadata 
177 as holding the publisher information for this volume.  Default: none. 
178 </dd><dt>'''volume-id'''=''string''</dt><dd> 
179 The specified string will be used as the Volume Identifier in the ISO9660 metadata. 
180 It is limited to 32 bytes. Default: none. 
181 </dd></dl> 
182 </dd><dt>Format iso9660 - boot support</dt><dd> 
183 These options are used to make an ISO9660 image that can be directly 
184 booted on various systems. 
185 <dl> 
186 <dt>'''boot'''=''filename''</dt><dd> 
187 The file matching this name will be used as the El Torito boot image file. 
188 </dd><dt>'''boot-catalog'''=''name''</dt><dd> 
189 The name that will be used for the El Torito boot catalog. 
190 Default: 
191 ''boot.catalog'' 
192 </dd><dt>'''boot-info-table'''</dt><dd> 
193 The boot image file provided by the 
194 '''boot'''=''filename'' 
195 option will be edited with appropriate boot information in bytes 8 through 64. 
196 Default: disabled 
197 </dd><dt>'''boot-load-seg'''=''hexadecimal-number''</dt><dd> 
198 The load segment for a no-emulation boot image. 
199 </dd><dt>'''boot-load-size'''=''decimal-number''</dt><dd> 
200 The number of "virtual" 512-byte sectors to be loaded from a no-emulation boot image. 
201 Some very old BIOSes can only load very small images, setting this 
202 value to 4 will often allow such BIOSes to load the first part of 
203 the boot image (which will then need to be intelligent enough to 
204 load the rest of itself). 
205 This should not be needed unless you are trying to support systems with very old BIOSes. 
206 This defaults to the full size of the image. 
207 </dd><dt>'''boot-type'''=''value''</dt><dd> 
208 Specifies the boot semantics used by the El Torito boot image: 
209 If the 
210 ''value'' 
211 is 
212 '''fd''', 
213 then the boot image is assumed to be a bootable floppy image. 
214 If the 
215 ''value'' 
216 is 
217 '''hd''', 
218 then the boot image is assumed to be a bootable hard disk image. 
219 If the 
220 ''value'' 
221 is 
222 '''no-emulation''', 
223 the boot image is used without floppy or hard disk emulation. 
224 If the boot image is exactly 1.2MB, 1.44MB, or 2.88MB, then 
225 the default is 
226 '''fd''', 
227 otherwise the default is 
228 '''no-emulation.''' 
229 </dd></dl> 
230 </dd><dt>Format iso9660 - filename and size extensions</dt><dd> 
231 Various extensions to the base ISO9660 format. 
232 <dl> 
233 <dt>'''allow-ldots'''</dt><dd> 
234 If enabled, allows filenames to begin with a leading period. 
235 If disabled, filenames that begin with a leading period will have 
236 that period replaced by an underscore character in the standard ISO9660 
237 namespace. 
238 This does not impact names stored in the Rockridge or Joliet extension area. 
239 Default: disabled. 
240 </dd><dt>'''allow-lowercase'''</dt><dd> 
241 If enabled, allows filenames to contain lowercase characters. 
242 If disabled, filenames will be forced to uppercase. 
243 This does not impact names stored in the Rockridge or Joliet extension area. 
244 Default: disabled. 
245 </dd><dt>'''allow-multidot'''</dt><dd> 
246 If enabled, allows filenames to contain multiple period characters, in violation of the ISO9660 specification. 
247 If disabled, additional periods will be converted to underscore characters. 
248 This does not impact names stored in the Rockridge or Joliet extension area. 
249 Default: disabled. 
250 </dd><dt>'''allow-period'''</dt><dd> 
251 If enabled, allows filenames to contain trailing period characters, in violation of the ISO9660 specification. 
252 If disabled,trailing periods will be converted to underscore characters. 
253 This does not impact names stored in the Rockridge or Joliet extension area. 
254 Default: disabled. 
255 </dd><dt>'''allow-pvd-lowercase'''</dt><dd> 
256 If enabled, the Primary Volume Descriptor may contain lowercase ASCII characters, in violation of the ISO9660 specification. 
257 If disabled, characters will be converted to uppercase ASCII. 
258 Default: disabled. 
259 </dd><dt>'''allow-sharp-tilde'''</dt><dd> 
260 If enabled, sharp and tilde characters will be permitted in filenames, in violation if the ISO9660 specification. 
261 If disabled, such characters will be converted to underscore characters. 
262 Default: disabled. 
263 </dd><dt>'''allow-vernum'''</dt><dd> 
264 If enabled, version numbers will be included with files. 
265 If disabled, version numbers will be suppressed, in violation of the ISO9660 standard. 
266 This does not impact names stored in the Rockridge or Joliet extension area. 
267 Default: enabled. 
268 </dd><dt>'''iso-level'''</dt><dd> 
269 This enables support for file size and file name extensions in the 
270 core ISO9660 area. 
271 The name extensions specified here do not affect the names stored in the Rockridge or Joliet extension areas. 
272 <dl> 
273 <dt>'''iso-level=1'''</dt><dd> 
274 The most compliant form of ISO9660 image. 
275 Filenames are limited to 8.3 uppercase format, 
276 directory names are limited to 8 uppercase characters, 
277 files are limited to 4 GiB, 
278 the complete ISO9660 image cannot exceed 4 GiB. 
279 </dd><dt>'''iso-level=2'''</dt><dd> 
280 Filenames are limited to 30 uppercase characters with a 30-character extension, 
281 directory names are limited to 30 characters, 
282 files are limited to 4 GiB. 
283 </dd><dt>'''iso-level=3'''</dt><dd> 
284 As with 
285 '''iso-level=2''', 
286 except that files may exceed 4 GiB. 
287 </dd><dt>'''iso-level=4'''</dt><dd> 
288 As with 
289 '''iso-level=3''', 
290 except that filenames may be up to 193 characters 
291 and may include arbitrary 8-bit characters. 
292 </dd></dl> 
293 </dd><dt>'''joliet'''</dt><dd> 
294 Microsoft's Joliet extensions store a completely separate set of directory information about each file. 
295 In particular, this information includes Unicode filenames of up to 255 characters. 
296 Default: enabled. 
297 </dd><dt>'''limit-depth'''</dt><dd> 
298 If enabled, libarchive will use directory relocation records to ensure that 
299 no pathname exceeds the ISO9660 limit of 8 directory levels. 
300 If disabled, no relocation will occur. 
301 Default: enabled. 
302 </dd><dt>'''limit-dirs'''</dt><dd> 
303 If enabled, libarchive will cause an error if there are more than 
304 65536 directories. 
305 If disabled, there is no limit on the number of directories. 
306 Default: enabled 
307 </dd><dt>'''pad'''</dt><dd> 
308 If enabled, 300 kiB of zero bytes will be appended to the end of the archive. 
309 Default: enabled 
310 </dd><dt>'''relaxed-filenames'''</dt><dd> 
311 If enabled, all 7-bit ASCII characters are permitted in filenames 
312 (except lowercase characters unless 
313 '''allow-lowercase''' 
314 is also specified). 
315 This violates ISO9660 standards. 
316 This does not impact names stored in the Rockridge or Joliet extension area. 
317 Default: disabled. 
318 </dd><dt>'''rockridge'''</dt><dd> 
319 The Rockridge extensions store an additional set of POSIX-style file 
320 information with each file, including mtime, atime, ctime, permissions, 
321 and long filenames with arbitrary 8-bit characters. 
322 These extensions also support symbolic links and other POSIX file types. 
323 Default: enabled. 
324 </dd></dl> 
325 </dd><dt>Format iso9660 - zisofs support</dt><dd> 
326 The zisofs extensions permit each file to be independently compressed 
327 using a gzip-compatible compression. 
328 This can provide significant size savings, but requires the reading 
329 system to have support for these extensions. 
330 These extensions are disabled by default. 
331 <dl> 
332 <dt>'''compression-level'''=number</dt><dd> 
333 The compression level used by the deflate compressor. 
334 Ranges from 0 (least effort) to 9 (most effort). 
335 Default: 6 
336 </dd><dt>'''zisofs'''</dt><dd> 
337 Synonym for 
338 '''zisofs=direct'''. 
339 </dd><dt>'''zisofs=direct'''</dt><dd> 
340 Compress each file in the archive. 
341 Unlike 
342 '''zisofs=indirect''', 
343 this is handled entirely within libarchive and does not require a 
344 separate utility. 
345 For best results, libarchive tests each file and will store 
346 the file uncompressed if the compression does not actually save any space. 
347 In particular, files under 2k will never be compressed. 
348 Note that boot image files are never compressed. 
349 </dd><dt>'''zisofs=indirect'''</dt><dd> 
350 Recognizes files that have already been compressed with the 
351 '''mkzftree''' 
352 utility and sets up the necessary file metadata so that 
353 readers will correctly identify these as zisofs-compressed files. 
354 </dd><dt>'''zisofs-exclude'''=''filename''</dt><dd> 
355 Specifies a filename that should not be compressed when using 
356 '''zisofs=direct'''. 
357 This option can be provided multiple times to suppress compression 
358 on many files. 
359 </dd></dl> 
360 </dd><dt>Format zip</dt><dd> 
361 <dl> 
362 <dt>'''compression'''</dt><dd> 
363 The value is either 
364 "store" 
365 or 
366 "deflate" 
367 to indicate how the following entries should be compressed. 
368 Note that this setting is ignored for directories, symbolic links, 
369 and other special entries. 
370 </dd><dt>'''experimental'''</dt><dd> 
371 This boolean option enables or disables experimental Zip features 
372 that may not be compatible with other Zip implementations. 
373 </dd><dt>'''fakecrc32'''</dt><dd> 
374 This boolean option disables CRC calculations. 
375 All CRC fields are set to zero. 
376 It should not be used except for testing purposes. 
377 </dd><dt>'''hdrcharset'''</dt><dd> 
378 This sets the character set used for filenames. 
379 </dd><dt>'''zip64'''</dt><dd> 
380 Zip64 extensions provide additional file size information 
381 for entries larger than 4 GiB. 
382 They also provide extended file offset and archive size information 
383 when archives exceed 4 GiB. 
384 By default, the Zip writer selectively enables these extensions only as needed. 
385 In particular, if the file size is unknown, the Zip writer will 
386 include Zip64 extensions to guard against the possibility that the 
387 file might be larger than 4 GiB. 
388
389 Setting this boolean option will force the writer to use Zip64 extensions 
390 even for small files that would not otherwise require them. 
391 This is primarily useful for testing. 
392
393 Disabling this option with 
394 '''!zip64''' 
395 will force the Zip writer to avoid Zip64 extensions: 
396 It will reject files with size greater than 4 GiB, 
397 it will reject any new entries once the total archive size reaches 4 GiB, 
398 and it will not use Zip64 extensions for files with unknown size. 
399 In particular, this can improve compatibility when generating archives 
400 where the entry sizes are not known in advance. 
401 </dd></dl> 
402 </dd></dl> 
403 == EXAMPLES == 
404 The following example creates an archive write handle to 
405 create a gzip-compressed ISO9660 format image. 
406 The two options here specify that the ISO9660 archive will use 
407 ''kernel.img'' 
408 as the boot image for El Torito booting, and that the gzip 
409 compressor should use the maximum compression level. 
410 ```text
411 a = archive_write_new();
412 archive_write_add_filter_gzip(a);
413 archive_write_set_format_iso9660(a);
414 archive_write_set_options(a, "boot=kernel.img,compression=9");
415 archive_write_open_filename(a, filename, blocksize);
416 ```
417 == ERRORS == 
418 More detailed error codes and textual descriptions are available from the 
419 '''archive_errno'''() 
420 and 
421 '''archive_error_string'''() 
422 functions. 
423 == SEE ALSO == 
424 [[ManPageBsdtar1]], 
425 [[ManPageibarchive3]], 
426 [[ManPagerchiveeadetptions3]], 
427 [[ManPagerchiverite3]] 
428 == HISTORY == 
429 The 
430 '''libarchive''' 
431 library first appeared in 
432 FreeBSD 5.3. 
433 == AUTHORS == 
434 The options support for libarchive was originally implemented by 
435 Michihiro NAKAJIMA. 
436 == BUGS ==