#squash-fs #app-image #linux

squishy

A convenient high level library for reading SquashFS files

7 releases

0.3.2 Jan 14, 2025
0.3.1 Jan 11, 2025
0.3.0 Dec 1, 2024
0.2.1 Dec 1, 2024
0.1.1 Nov 10, 2024

#1070 in Filesystem

Download history 224/week @ 2025-01-08 94/week @ 2025-01-15 43/week @ 2025-01-22 125/week @ 2025-01-29 130/week @ 2025-02-05 102/week @ 2025-02-12 102/week @ 2025-02-19 185/week @ 2025-02-26 125/week @ 2025-03-05 65/week @ 2025-03-12 85/week @ 2025-03-19 56/week @ 2025-03-26 70/week @ 2025-04-02 57/week @ 2025-04-09

276 downloads per month
Used in 3 crates (2 directly)

MIT license

22KB
340 lines

🗜️ Squishy

License: MIT

A convenient wrapper around the backhand library for reading and extracting files from SquashFS filesystems. Provides both a library and CLI tool.

Features

  • Read and extract files from SquashFS filesystems
  • Traverse filesystem entries
  • Handle symlinks with cycle detection
  • Search for files using custom predicates

Usage

Add this to your Cargo.toml:

[dependencies]
squishy = "0.2.1"

Example

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")?;

License

This project is licensed under the [MIT] License - see the LICENSE file for details.

Dependencies

~7MB
~128K SLoC