squashfs-ng

Crates.iosquashfs-ng
lib.rssquashfs-ng
version0.1.3
sourcesrc
created_at2022-10-31 14:36:07.330236
updated_at2024-03-21 14:33:45.83075
descriptionHigh-level Rust wrapper for squashfs-tools-ng
homepage
repositoryhttps://github.com/showermat/squashfs-ng-rs
max_upload_size
id702243
size218,339
Matthew Schauer (showermat)

documentation

https://docs.rs/squashfs-ng

README

squashfs-ng-rs

This library wraps the squashfs-tools-ng libraries, providing tools for reading and writing SquashFS archives. It aims to provide safe high-level abstractions over the lower-level interface provided by the underlying library.

// Create an archive from a file hierarchy on disk
use squashfs::write::TreeProcessor;
TreeProcessor::new("archive.sfs")?.process("/path/to/directory")?;

// Read the contents of a file from an archive
use squashfs::read::Archive;
let archive = Archive::open("archive.sfs")?;
match archive.get("/etc/passwd")? {
    None => println!("File not present"),
    Some(node) => if let Data::File(file) = node.data()? {
        println!("{}", file.to_string()?);
    },
}

Squashfs-tools-ng must be installed to build or use this library -- for example, squashfs-tools-ng in the AUR for Arch Linux. The current commit is intended to be built against release v1.3.0.

See the API documentation for more.

Commit count: 17

cargo fmt