6 releases

0.2.0 Aug 12, 2024
0.1.4 Aug 2, 2024

#281 in Compression

Download history 343/week @ 2024-07-30 102/week @ 2024-08-06 42/week @ 2024-08-13 3/week @ 2024-09-10 9/week @ 2024-09-24 38/week @ 2024-10-01

253 downloads per month

BSD-2-Clause

1MB
21K SLoC

C 17K SLoC // 0.2% comments Rust 3K SLoC // 0.0% comments Shell 229 SLoC // 0.3% comments C++ 26 SLoC // 0.6% comments

Sqsh-rs Crates.io Docs.rs License

A Rust wrapper for the libsqsh library.

Example

This is a simple example that a) prints the content of a file and b) lists the content of a directory.

use std::io::Write;
use sqsh_rs::Archive;

fn example() -> std::io::Result<()> {
    let mut archive = Archive::new("tests/data/test.sqsh")?;
    let contents: Vec<u8> = archive.read("/subdir/short.file")?;
    std::io::stdout().write_all(&contents)?;

    let directory = archive.open("/subdir")?;
    let mut iter = directory.as_dir()?;
    while let Some(entry) = iter.advance()? {
        println!("{}", entry.name());
    }

    Ok(())
}

example().unwrap();

Dependencies

~0.5–2.6MB
~40K SLoC