Blame doc/wiki/ManPageArchiveWriteSetOptions3.wiki

Packit 08bd4c
ARCHIVE_WRITE_OPTIONS(3) manual page 
Packit 08bd4c
== NAME == 
Packit 08bd4c
'''archive_write_set_filter_option''', 
Packit 08bd4c
'''archive_write_set_format_option''', 
Packit 08bd4c
'''archive_write_set_option''', 
Packit 08bd4c
'''archive_write_set_options''' 
Packit 08bd4c
- functions controlling options for writing archives 
Packit 08bd4c
== LIBRARY == 
Packit 08bd4c
Streaming Archive Library (libarchive, -larchive) 
Packit 08bd4c
== SYNOPSIS == 
Packit 08bd4c

Packit 08bd4c
''int'' 
Packit 08bd4c

Packit 08bd4c
'''archive_write_set_filter_option'''(''struct archive *'', ''const char *module'', ''const char *option'', ''const char *value''); 
Packit 08bd4c

Packit 08bd4c
''int'' 
Packit 08bd4c

Packit 08bd4c
'''archive_write_set_format_option'''(''struct archive *'', ''const char *module'', ''const char *option'', ''const char *value''); 
Packit 08bd4c

Packit 08bd4c
''int'' 
Packit 08bd4c

Packit 08bd4c
'''archive_write_set_option'''(''struct archive *'', ''const char *module'', ''const char *option'', ''const char *value''); 
Packit 08bd4c

Packit 08bd4c
''int'' 
Packit 08bd4c

Packit 08bd4c
'''archive_write_set_options'''(''struct archive *'', ''const char *options''); 
Packit 08bd4c
== DESCRIPTION == 
Packit 08bd4c
These functions provide a way for libarchive clients to configure 
Packit 08bd4c
specific write modules. 
Packit 08bd4c
Packit 08bd4c
Packit 08bd4c
'''archive_write_set_filter_option'''(), 
Packit 08bd4c
'''archive_write_set_format_option'''() 
Packit 08bd4c
 
Packit 08bd4c
Specifies an option that will be passed to currently-registered 
Packit 08bd4c
filters (including decompression filters) or format readers. 
Packit 08bd4c
Packit 08bd4c
If 
Packit 08bd4c
''option'' 
Packit 08bd4c
and 
Packit 08bd4c
''value'' 
Packit 08bd4c
are both 
Packit 08bd4c
NULL, 
Packit 08bd4c
these functions will do nothing and 
Packit 08bd4c
'''ARCHIVE_OK''' 
Packit 08bd4c
will be returned. 
Packit 08bd4c
If 
Packit 08bd4c
''option'' 
Packit 08bd4c
is 
Packit 08bd4c
NULL 
Packit 08bd4c
but 
Packit 08bd4c
''value'' 
Packit 08bd4c
is not, these functions will do nothing and 
Packit 08bd4c
'''ARCHIVE_FAILED''' 
Packit 08bd4c
will be returned. 
Packit 08bd4c
Packit 08bd4c
If 
Packit 08bd4c
''module'' 
Packit 08bd4c
is not 
Packit 08bd4c
NULL, 
Packit 08bd4c
''option'' 
Packit 08bd4c
and 
Packit 08bd4c
''value'' 
Packit 08bd4c
will be provided to the filter or reader named 
Packit 08bd4c
''module''. 
Packit 08bd4c
The return value will be either 
Packit 08bd4c
'''ARCHIVE_OK''' 
Packit 08bd4c
if the option was successfully handled or 
Packit 08bd4c
'''ARCHIVE_WARN''' 
Packit 08bd4c
if the option was unrecognized by the module or could otherwise 
Packit 08bd4c
not be handled. 
Packit 08bd4c
If there is no such module, 
Packit 08bd4c
'''ARCHIVE_FAILED''' 
Packit 08bd4c
will be returned. 
Packit 08bd4c
Packit 08bd4c
If 
Packit 08bd4c
''module'' 
Packit 08bd4c
is 
Packit 08bd4c
NULL, 
Packit 08bd4c
''option'' 
Packit 08bd4c
and 
Packit 08bd4c
''value'' 
Packit 08bd4c
will be provided to every registered module. 
Packit 08bd4c
If any module returns 
Packit 08bd4c
'''ARCHIVE_FATAL''', 
Packit 08bd4c
this value will be returned immediately. 
Packit 08bd4c
Otherwise, 
Packit 08bd4c
'''ARCHIVE_OK''' 
Packit 08bd4c
will be returned if any module accepts the option, and 
Packit 08bd4c
'''ARCHIVE_FAILED''' 
Packit 08bd4c
in all other cases. 
Packit 08bd4c
'''archive_write_set_option'''()
Packit 08bd4c
Calls 
Packit 08bd4c
'''archive_write_set_format_option'''(), 
Packit 08bd4c
then 
Packit 08bd4c
'''archive_write_set_filter_option'''(). 
Packit 08bd4c
If either function returns 
Packit 08bd4c
'''ARCHIVE_FATAL''', 
Packit 08bd4c
'''ARCHIVE_FATAL''' 
Packit 08bd4c
will be returned 
Packit 08bd4c
immediately. 
Packit 08bd4c
Otherwise, greater of the two values will be returned. 
Packit 08bd4c
'''archive_write_set_options'''()
Packit 08bd4c
''options'' 
Packit 08bd4c
is a comma-separated list of options. 
Packit 08bd4c
If 
Packit 08bd4c
''options'' 
Packit 08bd4c
is 
Packit 08bd4c
NULL 
Packit 08bd4c
or empty, 
Packit 08bd4c
'''ARCHIVE_OK''' 
Packit 08bd4c
will be returned immediately. 
Packit 08bd4c
Packit 08bd4c
Individual options have one of the following forms: 
Packit 08bd4c
Packit 08bd4c
''option=value''
Packit 08bd4c
The option/value pair will be provided to every module. 
Packit 08bd4c
Modules that do not accept an option with this name will ignore it. 
Packit 08bd4c
''option''
Packit 08bd4c
The option will be provided to every module with a value of 
Packit 08bd4c
"1". 
Packit 08bd4c
''!option''
Packit 08bd4c
The option will be provided to every module with a NULL value. 
Packit 08bd4c
''module:option=value'', ''module:option'', ''module:!option''
Packit 08bd4c
As above, but the corresponding option and value will be provided 
Packit 08bd4c
only to modules whose name matches 
Packit 08bd4c
''module''. 
Packit 08bd4c
 
Packit 08bd4c
 
Packit 08bd4c
== OPTIONS == 
Packit 08bd4c
Packit 08bd4c
Filter gzip
Packit 08bd4c
Packit 08bd4c
'''compression-level'''
Packit 08bd4c
The value is interpreted as a decimal integer specifying the 
Packit 08bd4c
gzip compression level. 
Packit 08bd4c
 
Packit 08bd4c
Filter xz
Packit 08bd4c
Packit 08bd4c
'''compression-level'''
Packit 08bd4c
The value is interpreted as a decimal integer specifying the 
Packit 08bd4c
compression level. 
Packit 08bd4c
 
Packit 08bd4c
Format mtree
Packit 08bd4c
Packit 08bd4c
'''cksum''', '''device''', '''flags''', '''gid''', '''gname''', '''indent''', '''link''', '''md5''', '''mode''', '''nlink''', '''rmd160''', '''sha1''', '''sha256''', '''sha384''', '''sha512''', '''size''', '''time''', '''uid''', '''uname'''
Packit 08bd4c
Enable a particular keyword in the mtree output. 
Packit 08bd4c
Prefix with an exclamation mark to disable the corresponding keyword. 
Packit 08bd4c
The default is equivalent to 
Packit 08bd4c
"device, flags, gid, gname, link, mode, nlink, size, time, type, uid, uname". 
Packit 08bd4c
'''all'''
Packit 08bd4c
Enables all of the above keywords. 
Packit 08bd4c
'''use-set'''
Packit 08bd4c
Enables generation of 
Packit 08bd4c
'''/set''' 
Packit 08bd4c
lines that specify default values for the following files and/or directories. 
Packit 08bd4c
'''indent'''
Packit 08bd4c
XXX needs explanation XXX 
Packit 08bd4c
 
Packit 08bd4c
Format iso9660 - volume metadata
Packit 08bd4c
These options are used to set standard ISO9660 metadata. 
Packit 08bd4c
Packit 08bd4c
'''abstract-file'''=''filename''
Packit 08bd4c
The file with the specified name will be identified in the ISO9660 metadata 
Packit 08bd4c
as holding the abstract for this volume.  Default: none. 
Packit 08bd4c
'''application-id'''=''filename''
Packit 08bd4c
The file with the specified name will be identified in the ISO9660 metadata 
Packit 08bd4c
as holding the application identifier for this volume.  Default: none. 
Packit 08bd4c
'''biblio-file'''=''filename''
Packit 08bd4c
The file with the specified name will be identified in the ISO9660 metadata 
Packit 08bd4c
as holding the bibliography for this volume.  Default: none. 
Packit 08bd4c
'''copyright-file'''=''filename''
Packit 08bd4c
The file with the specified name will be identified in the ISO9660 metadata 
Packit 08bd4c
as holding the copyright for this volume.  Default: none. 
Packit 08bd4c
'''publisher'''=''filename''
Packit 08bd4c
The file with the specified name will be identified in the ISO9660 metadata 
Packit 08bd4c
as holding the publisher information for this volume.  Default: none. 
Packit 08bd4c
'''volume-id'''=''string''
Packit 08bd4c
The specified string will be used as the Volume Identifier in the ISO9660 metadata. 
Packit 08bd4c
It is limited to 32 bytes. Default: none. 
Packit 08bd4c
 
Packit 08bd4c
Format iso9660 - boot support
Packit 08bd4c
These options are used to make an ISO9660 image that can be directly 
Packit 08bd4c
booted on various systems. 
Packit 08bd4c
Packit 08bd4c
'''boot'''=''filename''
Packit 08bd4c
The file matching this name will be used as the El Torito boot image file. 
Packit 08bd4c
'''boot-catalog'''=''name''
Packit 08bd4c
The name that will be used for the El Torito boot catalog. 
Packit 08bd4c
Default: 
Packit 08bd4c
''boot.catalog'' 
Packit 08bd4c
'''boot-info-table'''
Packit 08bd4c
The boot image file provided by the 
Packit 08bd4c
'''boot'''=''filename'' 
Packit 08bd4c
option will be edited with appropriate boot information in bytes 8 through 64. 
Packit 08bd4c
Default: disabled 
Packit 08bd4c
'''boot-load-seg'''=''hexadecimal-number''
Packit 08bd4c
The load segment for a no-emulation boot image. 
Packit 08bd4c
'''boot-load-size'''=''decimal-number''
Packit 08bd4c
The number of "virtual" 512-byte sectors to be loaded from a no-emulation boot image. 
Packit 08bd4c
Some very old BIOSes can only load very small images, setting this 
Packit 08bd4c
value to 4 will often allow such BIOSes to load the first part of 
Packit 08bd4c
the boot image (which will then need to be intelligent enough to 
Packit 08bd4c
load the rest of itself). 
Packit 08bd4c
This should not be needed unless you are trying to support systems with very old BIOSes. 
Packit 08bd4c
This defaults to the full size of the image. 
Packit 08bd4c
'''boot-type'''=''value''
Packit 08bd4c
Specifies the boot semantics used by the El Torito boot image: 
Packit 08bd4c
If the 
Packit 08bd4c
''value'' 
Packit 08bd4c
is 
Packit 08bd4c
'''fd''', 
Packit 08bd4c
then the boot image is assumed to be a bootable floppy image. 
Packit 08bd4c
If the 
Packit 08bd4c
''value'' 
Packit 08bd4c
is 
Packit 08bd4c
'''hd''', 
Packit 08bd4c
then the boot image is assumed to be a bootable hard disk image. 
Packit 08bd4c
If the 
Packit 08bd4c
''value'' 
Packit 08bd4c
is 
Packit 08bd4c
'''no-emulation''', 
Packit 08bd4c
the boot image is used without floppy or hard disk emulation. 
Packit 08bd4c
If the boot image is exactly 1.2MB, 1.44MB, or 2.88MB, then 
Packit 08bd4c
the default is 
Packit 08bd4c
'''fd''', 
Packit 08bd4c
otherwise the default is 
Packit 08bd4c
'''no-emulation.''' 
Packit 08bd4c
 
Packit 08bd4c
Format iso9660 - filename and size extensions
Packit 08bd4c
Various extensions to the base ISO9660 format. 
Packit 08bd4c
Packit 08bd4c
'''allow-ldots'''
Packit 08bd4c
If enabled, allows filenames to begin with a leading period. 
Packit 08bd4c
If disabled, filenames that begin with a leading period will have 
Packit 08bd4c
that period replaced by an underscore character in the standard ISO9660 
Packit 08bd4c
namespace. 
Packit 08bd4c
This does not impact names stored in the Rockridge or Joliet extension area. 
Packit 08bd4c
Default: disabled. 
Packit 08bd4c
'''allow-lowercase'''
Packit 08bd4c
If enabled, allows filenames to contain lowercase characters. 
Packit 08bd4c
If disabled, filenames will be forced to uppercase. 
Packit 08bd4c
This does not impact names stored in the Rockridge or Joliet extension area. 
Packit 08bd4c
Default: disabled. 
Packit 08bd4c
'''allow-multidot'''
Packit 08bd4c
If enabled, allows filenames to contain multiple period characters, in violation of the ISO9660 specification. 
Packit 08bd4c
If disabled, additional periods will be converted to underscore characters. 
Packit 08bd4c
This does not impact names stored in the Rockridge or Joliet extension area. 
Packit 08bd4c
Default: disabled. 
Packit 08bd4c
'''allow-period'''
Packit 08bd4c
If enabled, allows filenames to contain trailing period characters, in violation of the ISO9660 specification. 
Packit 08bd4c
If disabled,trailing periods will be converted to underscore characters. 
Packit 08bd4c
This does not impact names stored in the Rockridge or Joliet extension area. 
Packit 08bd4c
Default: disabled. 
Packit 08bd4c
'''allow-pvd-lowercase'''
Packit 08bd4c
If enabled, the Primary Volume Descriptor may contain lowercase ASCII characters, in violation of the ISO9660 specification. 
Packit 08bd4c
If disabled, characters will be converted to uppercase ASCII. 
Packit 08bd4c
Default: disabled. 
Packit 08bd4c
'''allow-sharp-tilde'''
Packit 08bd4c
If enabled, sharp and tilde characters will be permitted in filenames, in violation if the ISO9660 specification. 
Packit 08bd4c
If disabled, such characters will be converted to underscore characters. 
Packit 08bd4c
Default: disabled. 
Packit 08bd4c
'''allow-vernum'''
Packit 08bd4c
If enabled, version numbers will be included with files. 
Packit 08bd4c
If disabled, version numbers will be suppressed, in violation of the ISO9660 standard. 
Packit 08bd4c
This does not impact names stored in the Rockridge or Joliet extension area. 
Packit 08bd4c
Default: enabled. 
Packit 08bd4c
'''iso-level'''
Packit 08bd4c
This enables support for file size and file name extensions in the 
Packit 08bd4c
core ISO9660 area. 
Packit 08bd4c
The name extensions specified here do not affect the names stored in the Rockridge or Joliet extension areas. 
Packit 08bd4c
Packit 08bd4c
'''iso-level=1'''
Packit 08bd4c
The most compliant form of ISO9660 image. 
Packit 08bd4c
Filenames are limited to 8.3 uppercase format, 
Packit 08bd4c
directory names are limited to 8 uppercase characters, 
Packit 08bd4c
files are limited to 4 GiB, 
Packit 08bd4c
the complete ISO9660 image cannot exceed 4 GiB. 
Packit 08bd4c
'''iso-level=2'''
Packit 08bd4c
Filenames are limited to 30 uppercase characters with a 30-character extension, 
Packit 08bd4c
directory names are limited to 30 characters, 
Packit 08bd4c
files are limited to 4 GiB. 
Packit 08bd4c
'''iso-level=3'''
Packit 08bd4c
As with 
Packit 08bd4c
'''iso-level=2''', 
Packit 08bd4c
except that files may exceed 4 GiB. 
Packit 08bd4c
'''iso-level=4'''
Packit 08bd4c
As with 
Packit 08bd4c
'''iso-level=3''', 
Packit 08bd4c
except that filenames may be up to 193 characters 
Packit 08bd4c
and may include arbitrary 8-bit characters. 
Packit 08bd4c
 
Packit 08bd4c
'''joliet'''
Packit 08bd4c
Microsoft's Joliet extensions store a completely separate set of directory information about each file. 
Packit 08bd4c
In particular, this information includes Unicode filenames of up to 255 characters. 
Packit 08bd4c
Default: enabled. 
Packit 08bd4c
'''limit-depth'''
Packit 08bd4c
If enabled, libarchive will use directory relocation records to ensure that 
Packit 08bd4c
no pathname exceeds the ISO9660 limit of 8 directory levels. 
Packit 08bd4c
If disabled, no relocation will occur. 
Packit 08bd4c
Default: enabled. 
Packit 08bd4c
'''limit-dirs'''
Packit 08bd4c
If enabled, libarchive will cause an error if there are more than 
Packit 08bd4c
65536 directories. 
Packit 08bd4c
If disabled, there is no limit on the number of directories. 
Packit 08bd4c
Default: enabled 
Packit 08bd4c
'''pad'''
Packit 08bd4c
If enabled, 300 kiB of zero bytes will be appended to the end of the archive. 
Packit 08bd4c
Default: enabled 
Packit 08bd4c
'''relaxed-filenames'''
Packit 08bd4c
If enabled, all 7-bit ASCII characters are permitted in filenames 
Packit 08bd4c
(except lowercase characters unless 
Packit 08bd4c
'''allow-lowercase''' 
Packit 08bd4c
is also specified). 
Packit 08bd4c
This violates ISO9660 standards. 
Packit 08bd4c
This does not impact names stored in the Rockridge or Joliet extension area. 
Packit 08bd4c
Default: disabled. 
Packit 08bd4c
'''rockridge'''
Packit 08bd4c
The Rockridge extensions store an additional set of POSIX-style file 
Packit 08bd4c
information with each file, including mtime, atime, ctime, permissions, 
Packit 08bd4c
and long filenames with arbitrary 8-bit characters. 
Packit 08bd4c
These extensions also support symbolic links and other POSIX file types. 
Packit 08bd4c
Default: enabled. 
Packit 08bd4c
 
Packit 08bd4c
Format iso9660 - zisofs support
Packit 08bd4c
The zisofs extensions permit each file to be independently compressed 
Packit 08bd4c
using a gzip-compatible compression. 
Packit 08bd4c
This can provide significant size savings, but requires the reading 
Packit 08bd4c
system to have support for these extensions. 
Packit 08bd4c
These extensions are disabled by default. 
Packit 08bd4c
Packit 08bd4c
'''compression-level'''=number
Packit 08bd4c
The compression level used by the deflate compressor. 
Packit 08bd4c
Ranges from 0 (least effort) to 9 (most effort). 
Packit 08bd4c
Default: 6 
Packit 08bd4c
'''zisofs'''
Packit 08bd4c
Synonym for 
Packit 08bd4c
'''zisofs=direct'''. 
Packit 08bd4c
'''zisofs=direct'''
Packit 08bd4c
Compress each file in the archive. 
Packit 08bd4c
Unlike 
Packit 08bd4c
'''zisofs=indirect''', 
Packit 08bd4c
this is handled entirely within libarchive and does not require a 
Packit 08bd4c
separate utility. 
Packit 08bd4c
For best results, libarchive tests each file and will store 
Packit 08bd4c
the file uncompressed if the compression does not actually save any space. 
Packit 08bd4c
In particular, files under 2k will never be compressed. 
Packit 08bd4c
Note that boot image files are never compressed. 
Packit 08bd4c
'''zisofs=indirect'''
Packit 08bd4c
Recognizes files that have already been compressed with the 
Packit 08bd4c
'''mkzftree''' 
Packit 08bd4c
utility and sets up the necessary file metadata so that 
Packit 08bd4c
readers will correctly identify these as zisofs-compressed files. 
Packit 08bd4c
'''zisofs-exclude'''=''filename''
Packit 08bd4c
Specifies a filename that should not be compressed when using 
Packit 08bd4c
'''zisofs=direct'''. 
Packit 08bd4c
This option can be provided multiple times to suppress compression 
Packit 08bd4c
on many files. 
Packit 08bd4c
 
Packit 08bd4c
Format zip
Packit 08bd4c
Packit 08bd4c
'''compression'''
Packit 08bd4c
The value is either 
Packit 08bd4c
"store" 
Packit 08bd4c
or 
Packit 08bd4c
"deflate" 
Packit 08bd4c
to indicate how the following entries should be compressed. 
Packit 08bd4c
Note that this setting is ignored for directories, symbolic links, 
Packit 08bd4c
and other special entries. 
Packit 08bd4c
'''experimental'''
Packit 08bd4c
This boolean option enables or disables experimental Zip features 
Packit 08bd4c
that may not be compatible with other Zip implementations. 
Packit 08bd4c
'''fakecrc32'''
Packit 08bd4c
This boolean option disables CRC calculations. 
Packit 08bd4c
All CRC fields are set to zero. 
Packit 08bd4c
It should not be used except for testing purposes. 
Packit 08bd4c
'''hdrcharset'''
Packit 08bd4c
This sets the character set used for filenames. 
Packit 08bd4c
'''zip64'''
Packit 08bd4c
Zip64 extensions provide additional file size information 
Packit 08bd4c
for entries larger than 4 GiB. 
Packit 08bd4c
They also provide extended file offset and archive size information 
Packit 08bd4c
when archives exceed 4 GiB. 
Packit 08bd4c
By default, the Zip writer selectively enables these extensions only as needed. 
Packit 08bd4c
In particular, if the file size is unknown, the Zip writer will 
Packit 08bd4c
include Zip64 extensions to guard against the possibility that the 
Packit 08bd4c
file might be larger than 4 GiB. 
Packit 08bd4c
Packit 08bd4c
Setting this boolean option will force the writer to use Zip64 extensions 
Packit 08bd4c
even for small files that would not otherwise require them. 
Packit 08bd4c
This is primarily useful for testing. 
Packit 08bd4c
Packit 08bd4c
Disabling this option with 
Packit 08bd4c
'''!zip64''' 
Packit 08bd4c
will force the Zip writer to avoid Zip64 extensions: 
Packit 08bd4c
It will reject files with size greater than 4 GiB, 
Packit 08bd4c
it will reject any new entries once the total archive size reaches 4 GiB, 
Packit 08bd4c
and it will not use Zip64 extensions for files with unknown size. 
Packit 08bd4c
In particular, this can improve compatibility when generating archives 
Packit 08bd4c
where the entry sizes are not known in advance. 
Packit 08bd4c
 
Packit 08bd4c
 
Packit 08bd4c
== EXAMPLES == 
Packit 08bd4c
The following example creates an archive write handle to 
Packit 08bd4c
create a gzip-compressed ISO9660 format image. 
Packit 08bd4c
The two options here specify that the ISO9660 archive will use 
Packit 08bd4c
''kernel.img'' 
Packit 08bd4c
as the boot image for El Torito booting, and that the gzip 
Packit 08bd4c
compressor should use the maximum compression level. 
Packit 08bd4c
```text
Packit 08bd4c
a = archive_write_new();
Packit 08bd4c
archive_write_add_filter_gzip(a);
Packit 08bd4c
archive_write_set_format_iso9660(a);
Packit 08bd4c
archive_write_set_options(a, "boot=kernel.img,compression=9");
Packit 08bd4c
archive_write_open_filename(a, filename, blocksize);
Packit 08bd4c
```
Packit 08bd4c
== ERRORS == 
Packit 08bd4c
More detailed error codes and textual descriptions are available from the 
Packit 08bd4c
'''archive_errno'''() 
Packit 08bd4c
and 
Packit 08bd4c
'''archive_error_string'''() 
Packit 08bd4c
functions. 
Packit 08bd4c
== SEE ALSO == 
Packit 08bd4c
[[ManPageBsdtar1]], 
Packit 08bd4c
[[ManPageibarchive3]], 
Packit 08bd4c
[[ManPagerchiveeadetptions3]], 
Packit 08bd4c
[[ManPagerchiverite3]] 
Packit 08bd4c
== HISTORY == 
Packit 08bd4c
The 
Packit 08bd4c
'''libarchive''' 
Packit 08bd4c
library first appeared in 
Packit 08bd4c
FreeBSD 5.3. 
Packit 08bd4c
== AUTHORS == 
Packit 08bd4c
The options support for libarchive was originally implemented by 
Packit 08bd4c
Michihiro NAKAJIMA. 
Packit 08bd4c
== BUGS ==