| Crates.io | squishy |
| lib.rs | squishy |
| version | 0.3.2 |
| created_at | 2024-11-08 02:43:47.700457+00 |
| updated_at | 2025-01-14 14:54:38.184629+00 |
| description | A convenient high level library for reading SquashFS files |
| homepage | |
| repository | https://github.com/pkgforge/squishy-rs |
| max_upload_size | |
| id | 1440751 |
| size | 36,568 |
A convenient wrapper around the backhand library for reading and extracting files from SquashFS filesystems. Provides both a library and CLI tool.
Add this to your Cargo.toml:
[dependencies]
squishy = "0.2.1"
use squishy::{SquashFS, EntryKind};
use std::path::Path;
// Open a SquashFS file
let squashfs = SquashFS::from_path(&Path::new("example.squashfs"))?;
// List all entries
for entry in squashfs.entries() {
println!("{}", entry.path.display());
}
// Optionally, parallel read with rayon
use rayon::iter::ParallelIterator;
for entry in squashfs.par_entries() {
println!("{}", entry.path.display());
}
// Write file entries to disk
for entry in squashfs.entries() {
if let EntryKind::File(file) = entry.kind {
squashfs.write_file(file, "/path/to/output/file")?;
}
}
// Read a specific file
// Note: the whole file content will be loaded into memory
let contents = squashfs.read_file("path/to/file.txt")?;
This project is licensed under the [MIT] License - see the LICENSE file for details.