Extract files from the given archive into Dir. Supported
options:
- remove_prefix(+Prefix)
- Strip Prefix from all entries before extracting. If Prefix
is a list, then each prefix is tried in order, succeding at the first
one that matches. If no prefixes match, an error is reported. If Prefix
is an atom, then that prefix is removed.
- exclude(+ListOfPatterns)
- Ignore members that match one of the given patterns. Patterns are handed
to wildcard_match/2.
- include(+ListOfPatterns)
- Include members that match one of the given patterns. Patterns are
handed to wildcard_match/2. The
exclude
options takes preference if a member matches both the include
and the exclude option.
Only regular files are extracted. Entries whose path is absolute or
contains a .. segment are not extracted to avoid writing
outside Dir.
- Errors
- -
existence_error(directory, Dir) if Dir does
not exist or is not a directory.
- domain_error(path_prefix(Prefix), Path) if a path in the
archive does not start with Prefix
- permission_error(extract, archive_entry, Path) if the
path of a member is absolute or contains ...
- To be done
- Add options
- Fixed in 10.1.21 (👉ce3e902) archive_extract/3 could write files outside the target directory