#squashfs #app-image #linux

squishy

A convenient high level library for reading SquashFS files

3 unstable releases

new 0.2.0 Nov 15, 2024
0.1.1 Nov 10, 2024
0.1.0 Nov 8, 2024

#428 in Filesystem

Download history 202/week @ 2024-11-08

203 downloads per month
Used in squishy-cli

MIT license

13KB
176 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.1.0"

Example

use squishy::SquashFS;
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());
}

// Read a specific file
let contents = squashfs.read_file("path/to/file.txt")?;

// Extract a file
squashfs.write_file("source/path.txt", "destination/path.txt")?;

License

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

Dependencies

~6MB
~118K SLoC