Thanks to visit codestin.com
Credit goes to lib.rs

#tar-archive #archive-extract #unzip #archive

pulith-archive

Archive extraction with path sanitization and transactional staging

1 unstable release

Uses new Rust 2024

0.2.0 Apr 12, 2026

#910 in Compression


Used in 3 crates (2 directly)

Apache-2.0

120KB
3K SLoC

Archive extraction with path sanitization and transactional staging.

Architecture

  • detect.rs - Format detection
  • sanitize.rs - Path sanitization (zip-slip prevention)
  • workspace.rs - Transactional extraction
  • extract/ - Per-format implementations
  • data/ - Shared types
  • codec/ - Compression codecs
  • ops/ - Permission and hash operations

pulith-archive

Archive extraction with sanitization and transactional staging.

Role

pulith-archive owns archive materialization.

It provides:

  • archive format handling
  • extraction into a target/workspace
  • path sanitization
  • extraction reporting

It should not own:

  • store policy
  • install policy
  • fetch policy

Main APIs

  • extract_from_reader
  • ArchiveFormat
  • ArchiveReport
  • ExtractOptions
  • WorkspaceExtraction

Basic Usage

use pulith_archive::{extract_from_reader, ExtractOptions};

let zip_bytes = std::io::Cursor::new(Vec::<u8>::new());
let _ = extract_from_reader(zip_bytes, "out", &ExtractOptions::default());

How To Use It

Use this crate when a fetched or otherwise available archive needs to become a sanitized file tree that another crate can store or install.

See docs/design/archive.md.

Dependencies

~9–16MB
~323K SLoC