| Crates.io | stuffit |
| lib.rs | stuffit |
| version | 0.1.4 |
| created_at | 2025-12-25 09:51:20.374926+00 |
| updated_at | 2026-01-02 05:33:30.087659+00 |
| description | StuffIt (.sit) archive parser, decompressor, and creator |
| homepage | |
| repository | https://github.com/benletchford/stuffit-rs |
| max_upload_size | |
| id | 2004393 |
| size | 168,200 |
A Rust library (stuffit) and CLI tool for reading and writing StuffIt (.sit) archives.
Note: This library targets the classic StuffIt format (
.sit) used by StuffIt 1.x through 5.x. The newer StuffIt X format (.sitx, StuffIt 7.0+) is not yet supported.
Disclaimer: This project is not affiliated with, endorsed by, or connected to Smith Micro Software, Allume Systems, or the original StuffIt developers. "StuffIt" is used here as a descriptive term for the file format.
StuffIt was a popular compression format on classic Macintosh systems. This crate provides functionality to parse existing archives and create new ones, with support for the dual-fork file system used by classic Mac OS.
| Method | Name | Read | Write |
|---|---|---|---|
| 0 | None (store) | ✓ | ✓ |
| 13 | LZ77+Huffman | ✓ | ✓ |
| 14 | Deflate | ✓ | ✓ |
| 15 | Arsenic/BWT | ✓ | ✗ |
use stuffit::{SitArchive, SitEntry};
// Parse an existing archive
let data = std::fs::read("archive.sit")?;
let archive = SitArchive::parse(&data)?;
for entry in &archive.entries {
println!("{}: {} bytes (data), {} bytes (rsrc)",
entry.name,
entry.data_fork.len(),
entry.resource_fork.len()
);
}
// Create a new archive
let mut archive = SitArchive::new();
let entry = SitEntry {
name: "hello.txt".to_string(),
data_fork: b"Hello, World!".to_vec(),
file_type: *b"TEXT",
creator: *b"ttxt",
..Default::default()
};
archive.add_entry(entry);
// Write uncompressed
let bytes = archive.serialize()?;
// Or write with compression
let compressed = archive.serialize_compressed()?;
The crate includes a command-line tool (stuffit) for working with StuffIt archives.
# Simple list (just names)
stuffit list archive.sit
# Detailed list with metadata
stuffit list archive.sit --verbose
stuffit extract archive.sit -o output_dir
# Compressed (default, method 13)
stuffit archive -o output.sit file1.txt folder/
# Uncompressed
stuffit archive -o output.sit file1.txt folder/ -m 0
-v, --verbose - Show detailed progress or information-o, --output - Specify output path-m, --method - Compression method (0=none, 13=compressed)On macOS, the tool automatically handles:
file/..namedfork/rsrccom.apple.FinderInfoIcon\r file and folder flags# Install from crates.io
cargo install stuffit
# Or build from source
git clone https://github.com/benletchford/stuffit-rs
cd stuffit-rs
cargo build --release
# Library only
cargo build --no-default-features
# With CLI tool (default)
cargo build
Licensed under either of:
at your option.