2 library(archive): Access several archive formats
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog binding to libarchive
        • library(archive): 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
Availability::- use_module(library(archive)).(can be autoloaded)
Source[nondet]archive_data_stream(+Archive, -DataStream, +Options)
True when DataStream is a stream to a data object inside Archive. This predicate transparently unpacks data inside possibly nested archives, e.g., a tar file inside a zip file. It applies the appropriate decompression filters and thus ensures that Prolog reads the plain data from DataStream. DataStream must be closed after the content has been processed. Backtracking opens the next member of the (nested) archive. This predicate processes the following options:
meta_data(-Data:list(dict))
If provided, Data is unified with a list of filters applied to the (nested) archive to open the current DataStream. The first element describes the outermost archive. Each Data dict contains the header properties (archive_header_property/2) as well as the keys:
filters(Filters:list(atom))
Filter list as obtained from archive_property/2
name(Atom)
Name of the entry.

Non-archive files are handled as pseudo-archives that hold a single stream. This is implemented by using archive_open/3 with the options [format(all),format(raw)].