+Mode, -Archive, +Options)Open the archive in Data and unify Archive with a
handle to the opened archive. Data is either a file name (as
accepted by open/4) or a stream that has
been opened with the option
Data is an already open stream, the caller is responsible for
closing it (but see option
close_parent(true)) and must not
close the stream until after archive_close/1
is called. Mode is either
write. Details are controlled by Options.
Typically, the option
close_parent(true) is used to also
close the Data stream if the archive is closed using archive_close/1.
For other options when reading, the defaults are typically fine - for
writing, a valid format and optional filters must be specified. The
format(raw) must be used to process compressed streams that
do not contain explicit entries (e.g., gzip'ed data) unambibuously. The
raw format creates a pseudo archive holding a single
- If this option is
stream is closed when archive_close/1
is called on Archive. If Data is a file name, the
- Synomym for
- Support the indicated filter. This option may be used multiple times to
support multiple filters. In read mode, If no filter options are
all is assumed. In write mode,
is assumed. Supported values are
xz. The value
all is default for read,
- Support the indicated format. This option may be used multiple times to
support multiple formats in read mode. In write mode, you must supply a
single format. If no format options are provided,
assumed for read mode. Note that
all does not include
To open both archive and non-archive files, both
format(mtree) must be
specified. Supported values are:
zip. The value
all is default for read.
Note that the actually supported compression types and formats may
vary depending on the version and installation options of the underlying
libarchive library. This predicate raises a domain or permission error
if the (explicitly) requested format or filter is not supported.
domain_error(filter, Filter) if the requested filter is
all for writing).
domain_error(format, Format) if the requested format type
is not supported.
permission_error(set, filter, Filter) if the requested
filter is not supported.