Blame doc/text/archive_write_set_options.3.txt

Packit 08bd4c
ARCHIVE_WRITE_OPTIONS(3) BSD Library Functions Manual ARCHIVE_WRITE_OPTIONS(3)
Packit 08bd4c
Packit 08bd4c
NAME
Packit 08bd4c
     archive_write_set_filter_option, archive_write_set_format_option,
Packit 08bd4c
     archive_write_set_option, archive_write_set_options — functions control‐
Packit 08bd4c
     ling options for writing archives
Packit 08bd4c
Packit 08bd4c
LIBRARY
Packit 08bd4c
     Streaming Archive Library (libarchive, -larchive)
Packit 08bd4c
Packit 08bd4c
SYNOPSIS
Packit 08bd4c
     int
Packit 08bd4c
     archive_write_set_filter_option(struct archive *, const char *module,
Packit 08bd4c
	 const char *option, const char *value);
Packit 08bd4c
Packit 08bd4c
     int
Packit 08bd4c
     archive_write_set_format_option(struct archive *, const char *module,
Packit 08bd4c
	 const char *option, const char *value);
Packit 08bd4c
Packit 08bd4c
     int
Packit 08bd4c
     archive_write_set_option(struct archive *, const char *module,
Packit 08bd4c
	 const char *option, const char *value);
Packit 08bd4c
Packit 08bd4c
     int
Packit 08bd4c
     archive_write_set_options(struct archive *, const char *options);
Packit 08bd4c
Packit 08bd4c
DESCRIPTION
Packit 08bd4c
     These functions provide a way for libarchive clients to configure spe‐
Packit 08bd4c
     cific write modules.
Packit 08bd4c
Packit 08bd4c
     archive_write_set_filter_option(), archive_write_set_format_option()
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 option and value are both NULL, these functions will do noth‐
Packit 08bd4c
	     ing and ARCHIVE_OK will be returned.  If option is NULL but value
Packit 08bd4c
	     is not, these functions will do nothing and ARCHIVE_FAILED will
Packit 08bd4c
	     be returned.
Packit 08bd4c
Packit 08bd4c
	     If module is not NULL, option and value will be provided to the
Packit 08bd4c
	     filter or reader named module.  The return value will be either
Packit 08bd4c
	     ARCHIVE_OK if the option was successfully handled or ARCHIVE_WARN
Packit 08bd4c
	     if the option was unrecognized by the module or could otherwise
Packit 08bd4c
	     not be handled.  If there is no such module, ARCHIVE_FAILED will
Packit 08bd4c
	     be returned.
Packit 08bd4c
Packit 08bd4c
	     If module is NULL, option and value will be provided to every
Packit 08bd4c
	     registered module.  If any module returns ARCHIVE_FATAL, this
Packit 08bd4c
	     value will be returned immediately.  Otherwise, ARCHIVE_OK will
Packit 08bd4c
	     be returned if any module accepts the option, and ARCHIVE_FAILED
Packit 08bd4c
	     in all other cases.
Packit 08bd4c
Packit 08bd4c
     archive_write_set_option()
Packit 08bd4c
	     Calls archive_write_set_format_option(), then
Packit 08bd4c
	     archive_write_set_filter_option().  If either function returns
Packit 08bd4c
	     ARCHIVE_FATAL, ARCHIVE_FATAL will be returned immediately.  Oth‐
Packit 08bd4c
	     erwise, greater of the two values will be returned.
Packit 08bd4c
Packit 08bd4c
     archive_write_set_options()
Packit 08bd4c
	     options is a comma-separated list of options.  If options is NULL
Packit 08bd4c
	     or empty, ARCHIVE_OK will be returned immediately.
Packit 08bd4c
Packit 08bd4c
	     Individual options have one of the following forms:
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
Packit 08bd4c
		     ignore it.
Packit 08bd4c
	     option  The option will be provided to every module with a value
Packit 08bd4c
		     of “1”.
Packit 08bd4c
	     !option
Packit 08bd4c
		     The option will be provided to every module with a NULL
Packit 08bd4c
		     value.
Packit 08bd4c
	     module:option=value, module:option, module:!option
Packit 08bd4c
		     As above, but the corresponding option and value will be
Packit 08bd4c
		     provided only to modules whose name matches module.
Packit 08bd4c
Packit 08bd4c
OPTIONS
Packit 08bd4c
     Filter gzip
Packit 08bd4c
	     compression-level
Packit 08bd4c
		     The value is interpreted as a decimal integer specifying
Packit 08bd4c
		     the gzip compression level.
Packit 08bd4c
     Filter xz
Packit 08bd4c
	     compression-level
Packit 08bd4c
		     The value is interpreted as a decimal integer specifying
Packit 08bd4c
		     the compression level.
Packit 08bd4c
     Format mtree
Packit 08bd4c
	     cksum, device, flags, gid, gname, indent, link, md5, mode, nlink,
Packit 08bd4c
		     rmd160, sha1, sha256, sha384, sha512, size, time, uid,
Packit 08bd4c
		     uname
Packit 08bd4c
		     Enable a particular keyword in the mtree output.  Prefix
Packit 08bd4c
		     with an exclamation mark to disable the corresponding
Packit 08bd4c
		     keyword.  The default is equivalent to “device, flags,
Packit 08bd4c
		     gid, gname, link, mode, nlink, size, time, type, uid,
Packit 08bd4c
		     uname”.
Packit 08bd4c
	     all     Enables all of the above keywords.
Packit 08bd4c
	     use-set
Packit 08bd4c
		     Enables generation of /set lines that specify default
Packit 08bd4c
		     values for the following files and/or directories.
Packit 08bd4c
	     indent  XXX needs explanation XXX
Packit 08bd4c
     Format iso9660 - volume metadata
Packit 08bd4c
	     These options are used to set standard ISO9660 metadata.
Packit 08bd4c
	     abstract-file=filename
Packit 08bd4c
		     The file with the specified name will be identified in
Packit 08bd4c
		     the ISO9660 metadata as holding the abstract for this
Packit 08bd4c
		     volume.  Default: none.
Packit 08bd4c
	     application-id=filename
Packit 08bd4c
		     The file with the specified name will be identified in
Packit 08bd4c
		     the ISO9660 metadata as holding the application identi‐
Packit 08bd4c
		     fier for this volume.  Default: none.
Packit 08bd4c
	     biblio-file=filename
Packit 08bd4c
		     The file with the specified name will be identified in
Packit 08bd4c
		     the ISO9660 metadata as holding the bibliography for this
Packit 08bd4c
		     volume.  Default: none.
Packit 08bd4c
	     copyright-file=filename
Packit 08bd4c
		     The file with the specified name will be identified in
Packit 08bd4c
		     the ISO9660 metadata as holding the copyright for this
Packit 08bd4c
		     volume.  Default: none.
Packit 08bd4c
	     publisher=filename
Packit 08bd4c
		     The file with the specified name will be identified in
Packit 08bd4c
		     the ISO9660 metadata as holding the publisher information
Packit 08bd4c
		     for this volume.  Default: none.
Packit 08bd4c
	     volume-id=string
Packit 08bd4c
		     The specified string will be used as the Volume Identi‐
Packit 08bd4c
		     fier in the ISO9660 metadata.  It is limited to 32 bytes.
Packit 08bd4c
		     Default: none.
Packit 08bd4c
     Format iso9660 - boot support
Packit 08bd4c
	     These options are used to make an ISO9660 image that can be
Packit 08bd4c
	     directly booted on various systems.
Packit 08bd4c
	     boot=filename
Packit 08bd4c
		     The file matching this name will be used as the El Torito
Packit 08bd4c
		     boot image file.
Packit 08bd4c
	     boot-catalog=name
Packit 08bd4c
		     The name that will be used for the El Torito boot cata‐
Packit 08bd4c
		     log.  Default: boot.catalog
Packit 08bd4c
	     boot-info-table
Packit 08bd4c
		     The boot image file provided by the boot=filename option
Packit 08bd4c
		     will be edited with appropriate boot information in bytes
Packit 08bd4c
		     8 through 64.  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
Packit 08bd4c
		     from a no-emulation boot image.  Some very old BIOSes can
Packit 08bd4c
		     only load very small images, setting this value to 4 will
Packit 08bd4c
		     often allow such BIOSes to load the first part of the
Packit 08bd4c
		     boot image (which will then need to be intelligent enough
Packit 08bd4c
		     to load the rest of itself).  This should not be needed
Packit 08bd4c
		     unless you are trying to support systems with very old
Packit 08bd4c
		     BIOSes.  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
Packit 08bd4c
		     image: If the value is fd, then the boot image is assumed
Packit 08bd4c
		     to be a bootable floppy image.  If the value is hd, then
Packit 08bd4c
		     the boot image is assumed to be a bootable hard disk
Packit 08bd4c
		     image.  If the value is no-emulation, the boot image is
Packit 08bd4c
		     used without floppy or hard disk emulation.  If the boot
Packit 08bd4c
		     image is exactly 1.2MB, 1.44MB, or 2.88MB, then the
Packit 08bd4c
		     default is fd, otherwise the default is no-emulation.
Packit 08bd4c
     Format iso9660 - filename and size extensions
Packit 08bd4c
	     Various extensions to the base ISO9660 format.
Packit 08bd4c
	     allow-ldots
Packit 08bd4c
		     If enabled, allows filenames to begin with a leading
Packit 08bd4c
		     period.  If disabled, filenames that begin with a leading
Packit 08bd4c
		     period will have that period replaced by an underscore
Packit 08bd4c
		     character in the standard ISO9660 namespace.  This does
Packit 08bd4c
		     not impact names stored in the Rockridge or Joliet exten‐
Packit 08bd4c
		     sion area.  Default: disabled.
Packit 08bd4c
	     allow-lowercase
Packit 08bd4c
		     If enabled, allows filenames to contain lowercase charac‐
Packit 08bd4c
		     ters.  If disabled, filenames will be forced to upper‐
Packit 08bd4c
		     case.  This does not impact names stored in the Rockridge
Packit 08bd4c
		     or Joliet extension area.	Default: disabled.
Packit 08bd4c
	     allow-multidot
Packit 08bd4c
		     If enabled, allows filenames to contain multiple period
Packit 08bd4c
		     characters, in violation of the ISO9660 specification.
Packit 08bd4c
		     If disabled, additional periods will be converted to
Packit 08bd4c
		     underscore characters.  This does not impact names stored
Packit 08bd4c
		     in the Rockridge or Joliet extension area.  Default: dis‐
Packit 08bd4c
		     abled.
Packit 08bd4c
	     allow-period
Packit 08bd4c
		     If enabled, allows filenames to contain trailing period
Packit 08bd4c
		     characters, in violation of the ISO9660 specification.
Packit 08bd4c
		     If disabled,trailing periods will be converted to under‐
Packit 08bd4c
		     score characters.	This does not impact names stored in
Packit 08bd4c
		     the Rockridge or Joliet extension area.  Default: dis‐
Packit 08bd4c
		     abled.
Packit 08bd4c
	     allow-pvd-lowercase
Packit 08bd4c
		     If enabled, the Primary Volume Descriptor may contain
Packit 08bd4c
		     lowercase ASCII characters, in violation of the ISO9660
Packit 08bd4c
		     specification.  If disabled, characters will be converted
Packit 08bd4c
		     to uppercase ASCII.  Default: disabled.
Packit 08bd4c
	     allow-sharp-tilde
Packit 08bd4c
		     If enabled, sharp and tilde characters will be permitted
Packit 08bd4c
		     in filenames, in violation if the ISO9660 specification.
Packit 08bd4c
		     If disabled, such characters will be converted to under‐
Packit 08bd4c
		     score characters.	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 vio‐
Packit 08bd4c
		     lation of the ISO9660 standard.  This does not impact
Packit 08bd4c
		     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 exten‐
Packit 08bd4c
		     sions in the core ISO9660 area.  The name extensions
Packit 08bd4c
		     specified here do not affect the names stored in the
Packit 08bd4c
		     Rockridge or Joliet extension areas.
Packit 08bd4c
		     iso-level=1
Packit 08bd4c
			     The most compliant form of ISO9660 image.	File‐
Packit 08bd4c
			     names are limited to 8.3 uppercase format, direc‐
Packit 08bd4c
			     tory names are limited to 8 uppercase characters,
Packit 08bd4c
			     files are limited to 4 GiB, the complete ISO9660
Packit 08bd4c
			     image cannot exceed 4 GiB.
Packit 08bd4c
		     iso-level=2
Packit 08bd4c
			     Filenames are limited to 30 uppercase characters
Packit 08bd4c
			     with a 30-character extension, directory names
Packit 08bd4c
			     are limited to 30 characters, files are limited
Packit 08bd4c
			     to 4 GiB.
Packit 08bd4c
		     iso-level=3
Packit 08bd4c
			     As with iso-level=2, except that files may exceed
Packit 08bd4c
			     4 GiB.
Packit 08bd4c
		     iso-level=4
Packit 08bd4c
			     As with iso-level=3, except that filenames may be
Packit 08bd4c
			     up to 193 characters and may include arbitrary
Packit 08bd4c
			     8-bit characters.
Packit 08bd4c
	     joliet  Microsoft's Joliet extensions store a completely separate
Packit 08bd4c
		     set of directory information about each file.  In partic‐
Packit 08bd4c
		     ular, this information includes Unicode filenames of up
Packit 08bd4c
		     to 255 characters.  Default: enabled.
Packit 08bd4c
	     limit-depth
Packit 08bd4c
		     If enabled, libarchive will use directory relocation
Packit 08bd4c
		     records to ensure that no pathname exceeds the ISO9660
Packit 08bd4c
		     limit of 8 directory levels.  If disabled, no relocation
Packit 08bd4c
		     will occur.  Default: enabled.
Packit 08bd4c
	     limit-dirs
Packit 08bd4c
		     If enabled, libarchive will cause an error if there are
Packit 08bd4c
		     more than 65536 directories.  If disabled, there is no
Packit 08bd4c
		     limit on the number of directories.  Default: enabled
Packit 08bd4c
	     pad     If enabled, 300 kiB of zero bytes will be appended to the
Packit 08bd4c
		     end of the archive.  Default: enabled
Packit 08bd4c
	     relaxed-filenames
Packit 08bd4c
		     If enabled, all 7-bit ASCII characters are permitted in
Packit 08bd4c
		     filenames (except lowercase characters unless
Packit 08bd4c
		     allow-lowercase is also specified).  This violates
Packit 08bd4c
		     ISO9660 standards.  This does not impact names stored in
Packit 08bd4c
		     the Rockridge or Joliet extension area.  Default: dis‐
Packit 08bd4c
		     abled.
Packit 08bd4c
	     rockridge
Packit 08bd4c
		     The Rockridge extensions store an additional set of
Packit 08bd4c
		     POSIX-style file information with each file, including
Packit 08bd4c
		     mtime, atime, ctime, permissions, and long filenames with
Packit 08bd4c
		     arbitrary 8-bit characters.  These extensions also sup‐
Packit 08bd4c
		     port symbolic links and other POSIX file types.  Default:
Packit 08bd4c
		     enabled.
Packit 08bd4c
     Format iso9660 - zisofs support
Packit 08bd4c
	     The zisofs extensions permit each file to be independently com‐
Packit 08bd4c
	     pressed using a gzip-compatible compression.  This can provide
Packit 08bd4c
	     significant size savings, but requires the reading system to have
Packit 08bd4c
	     support for these extensions.  These extensions are disabled by
Packit 08bd4c
	     default.
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  Synonym for zisofs=direct.
Packit 08bd4c
	     zisofs=direct
Packit 08bd4c
		     Compress each file in the archive.  Unlike
Packit 08bd4c
		     zisofs=indirect, this is handled entirely within
Packit 08bd4c
		     libarchive and does not require a separate utility.  For
Packit 08bd4c
		     best results, libarchive tests each file and will store
Packit 08bd4c
		     the file uncompressed if the compression does not actu‐
Packit 08bd4c
		     ally save any space.  In particular, files under 2k will
Packit 08bd4c
		     never be compressed.  Note that boot image files are
Packit 08bd4c
		     never compressed.
Packit 08bd4c
	     zisofs=indirect
Packit 08bd4c
		     Recognizes files that have already been compressed with
Packit 08bd4c
		     the mkzftree utility and sets up the necessary file meta‐
Packit 08bd4c
		     data so that readers will correctly identify these as
Packit 08bd4c
		     zisofs-compressed files.
Packit 08bd4c
	     zisofs-exclude=filename
Packit 08bd4c
		     Specifies a filename that should not be compressed when
Packit 08bd4c
		     using zisofs=direct.  This option can be provided multi‐
Packit 08bd4c
		     ple times to suppress compression on many files.
Packit 08bd4c
     Format zip
Packit 08bd4c
	     compression
Packit 08bd4c
		     The value is either “store” or “deflate” to indicate how
Packit 08bd4c
		     the following entries should be compressed.  Note that
Packit 08bd4c
		     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
Packit 08bd4c
		     features that may not be compatible with other Zip imple‐
Packit 08bd4c
		     mentations.
Packit 08bd4c
	     fakecrc32
Packit 08bd4c
		     This boolean option disables CRC calculations.  All CRC
Packit 08bd4c
		     fields are set to zero.  It should not be used except for
Packit 08bd4c
		     testing purposes.
Packit 08bd4c
	     hdrcharset
Packit 08bd4c
		     This sets the character set used for filenames.
Packit 08bd4c
	     zip64   Zip64 extensions provide additional file size information
Packit 08bd4c
		     for entries larger than 4 GiB.  They also provide
Packit 08bd4c
		     extended file offset and archive size information when
Packit 08bd4c
		     archives exceed 4 GiB.  By default, the Zip writer selec‐
Packit 08bd4c
		     tively enables these extensions only as needed.  In par‐
Packit 08bd4c
		     ticular, if the file size is unknown, the Zip writer will
Packit 08bd4c
		     include Zip64 extensions to guard against the possibility
Packit 08bd4c
		     that the file might be larger than 4 GiB.
Packit 08bd4c
Packit 08bd4c
		     Setting this boolean option will force the writer to use
Packit 08bd4c
		     Zip64 extensions even for small files that would not oth‐
Packit 08bd4c
		     erwise require them.  This is primarily useful for test‐
Packit 08bd4c
		     ing.
Packit 08bd4c
Packit 08bd4c
		     Disabling this option with !zip64 will force the Zip
Packit 08bd4c
		     writer to avoid Zip64 extensions: It will reject files
Packit 08bd4c
		     with size greater than 4 GiB, it will reject any new
Packit 08bd4c
		     entries once the total archive size reaches 4 GiB, and it
Packit 08bd4c
		     will not use Zip64 extensions for files with unknown
Packit 08bd4c
		     size.  In particular, this can improve compatibility when
Packit 08bd4c
		     generating archives where the entry sizes are not known
Packit 08bd4c
		     in advance.
Packit 08bd4c
Packit 08bd4c
EXAMPLES
Packit 08bd4c
     The following example creates an archive write handle to create a gzip-
Packit 08bd4c
     compressed ISO9660 format image.  The two options here specify that the
Packit 08bd4c
     ISO9660 archive will use kernel.img as the boot image for El Torito boot‐
Packit 08bd4c
     ing, and that the gzip compressor should use the maximum compression
Packit 08bd4c
     level.
Packit 08bd4c
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() and archive_error_string() functions.
Packit 08bd4c
Packit 08bd4c
SEE ALSO
Packit 08bd4c
     tar(1), libarchive(3), archive_read_set_options(3), archive_write(3)
Packit 08bd4c
Packit 08bd4c
HISTORY
Packit 08bd4c
     The libarchive library first appeared in FreeBSD 5.3.
Packit 08bd4c
Packit 08bd4c
AUTHORS
Packit 08bd4c
     The options support for libarchive was originally implemented by
Packit 08bd4c
     Michihiro NAKAJIMA.
Packit 08bd4c
Packit 08bd4c
BUGS
Packit 08bd4c
BSD			       February 2, 2012 			   BSD