extract_archive

Function extract_archive 

Source
pub fn extract_archive<P: AsRef<Path>, Q: AsRef<Path>>(
    archive_path: P,
    output_dir: Q,
    config: &SecurityConfig,
) -> Result<ExtractionReport>
Expand description

Extracts an archive to the specified output directory.

This is the main high-level API for extracting archives with security validation. The archive format is automatically detected.

§Arguments

  • archive_path - Path to the archive file
  • output_dir - Directory where files will be extracted
  • config - Security configuration for the extraction

§Errors

Returns an error if:

  • Archive file cannot be opened
  • Archive format is unsupported
  • Security validation fails
  • I/O operations fail

§Examples

use exarch_core::SecurityConfig;
use exarch_core::extract_archive;

let config = SecurityConfig::default();
let report = extract_archive("archive.tar.gz", "/tmp/output", &config)?;
println!("Extracted {} files", report.files_extracted);