| Crates.io | squashfs_reader |
| lib.rs | squashfs_reader |
| version | 0.1.0 |
| created_at | 2025-07-27 13:22:45.510889+00 |
| updated_at | 2025-07-27 13:22:45.510889+00 |
| description | Fully featured rust reader for the squashfs archive format |
| homepage | |
| repository | https://github.com/Macdu/squashfs_reader |
| max_upload_size | |
| id | 1770061 |
| size | 121,745 |
Squashfs_reader is a rust crate offering full read-only access to squashfs archive files. It offers an api similar to std::io.
quick_cache to prevent unnecessary decompressions. The cache size can be configured.std::fs::ReadDir, and files implement the std::io::Read and std::io::Seek traits.use std::io;
use squashfs_reader::FileSystem;
fn main() -> io::Result<()> {
// Open a SquashFS file
let fs = FileSystem::from_path("example.squashfs")?;
// List contents of root directory
let root = fs.read_dir("/")?;
for entry in root {
println!("{}", entry?.name());
}
// Read a file
let mut file = fs.open("path/to/file.txt")?;
let file_size = file.seek(io::SeekFrom::End(0))?;
file.rewind()?;
let mut contents = String::new();
file.read_to_string(&mut contents)?;
Ok(())
}
best_performance (default) - Uses external (non-Rust) libraries when they offer better performance (liblzma and zstd-safe).only_rust- Only has Rust dependencies, but may offer lower performance when using some compression formats.If both features are enabled, only_rust will be prioritized.
This crate is entirely written in safe Rust (it uses #![forbid(unsafe_code)]). However, please note that some dependencies may contain unsafe code.