/usr/lib/swipl/library/ext/archive/archive.pl
All Application Manual Name SummaryHelp

  • archive
    • archive.pl -- Access several archive formats
      • archive_open/3
      • archive_open/4
      • archive_close/1
      • archive_property/2
      • archive_next_header/2
      • archive_open_entry/2
      • archive_set_header_property/2
      • archive_header_property/2
      • archive_extract/3
      • archive_entries/2
      • archive_data_stream/3
      • archive_create/3
      • archive_foldl/4
 archive_open(+Data, +Mode, -Archive, +Options) is det
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 type(binary). If 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 read or 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 option 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 member named data.
close_parent(+Boolean)
If this option is true (default false), Data stream is closed when archive_close/1 is called on Archive. If Data is a file name, the default is true.
filters(+Filters)
Support the filters in the list Filters. In read mode, if no filter is provided, all is assumed. In write mode, none is assumed and at most one filter is allowed. Supported values are all, bzip2, compress, gzip, grzip, lrzip, lzip, lzma, lzop, none, rpm, uu and xz.
formats(+Formats)
Support the formats in the list Formats. In write mode, you must supply a single format. If no format is provided, all is assumed for read mode. Note that all does not include raw and mtree. To open both archive and non-archive files, all together with raw and/or mtree must be specified. Supported values are all, 7zip, ar, cab, cpio, empty, gnutar, iso9660, lha, mtree, rar, raw, tar, xar and zip.
filter(+Filter)
format(+Format)
compression(+Filter)
Deprecated. Add a single filter or format. Repeating these options to support multiple filters/formats is deprecated in favour of filters/1 and formats/1. compression/1 is a synonym for filter/1.

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.

Errors
- domain_error(filter, Filter) if the requested filter is invalid (e.g., 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.