Helper functions for extracting archives (openrelik_worker_common.archive_utils).
Summary
Functions
Unpacks an archive using tar (for .tgz and .tar.gz) or 7z (for all other archive formats).
Functions
@spec extract_archive( map(), String.t(), String.t(), list() | keyword(), String.t() | nil, boolean(), list() ) :: {String.t(), String.t()}
Unpacks an archive using tar (for .tgz and .tar.gz) or 7z (for all other archive formats).
Parameters
input_file- Input file map containing"path"and"display_name".output_folder- OpenRelik output folder path.log_file- Path to write command stdout/stderr logs.opts- Optional keyword list (or positional arguments viaextract_archive/4..7)::file_filter- List of file patterns to extract (default[]).:archive_password- Password of the input archive (defaultnil).:ignore_prompts- Whether to ignore prompts during extraction (defaulttrue).:file_exclusion_filter- List of file patterns to exclude (default[]).:which_fn- Optional(String.t() -> String.t() | boolean() | nil)override forSystem.find_executable/1.:cmd_runner- Optional(command_list, log_file -> integer())override for command execution.:mkdir_fn- Optional(String.t() -> :ok)override for directory creation.
Returns
{command_string, export_folder} where command_string is the executed command string
and export_folder is the root folder path to the unpacked archive.