libpfs3
A pure Rust library for reading, writing, and manipulating PFS3 (Professional File System III) volumes — the most popular filesystem for Amiga hard drives.
Features
- Parse PFS3 on-disk structures (rootblock, directory entries, anodes) in big-endian format
- Read files, list directories, follow softlinks
- Write files, create directories, delete entries, rename, set protection bits
- Format new PFS3 volumes
- Filesystem consistency checker with optional repair
- RDB (Rigid Disk Block) partition table parsing with auto-detection
- SUPERINDEX support for large (multi-GB) volumes
- Deldir (trash) access for recovering deleted files
- LRU block cache
- No OS dependencies — works on any platform Rust supports
Usage
use Volume;
// Open a PFS3 disk image
let mut vol = open?;
// List root directory
for entry in vol.list_dir?
// Read a file
let data = vol.read_file?;
println!;
Writing
use Volume;
use Writer;
let vol = open?; // writable = true
let mut w = open?;
w.write_file?;
w.create_dir?;
RDB disk images
use Volume;
// Auto-detect first PFS3 partition in an RDB image
let mut vol = open_auto?;
Protection bits
use util;
// Parse and format Amiga protection bits
let prot = parse_amiga_protection.unwrap;
assert_eq!;
// Convert between Unix mode and Amiga protection
let mode = amiga_protection_to_mode;
Compatibility
Tested against volumes created by:
- pfs3aio — original AmigaOS driver
- Coffin OS R65 — 32GB multi-partition RDB images Supports MODE_SUPERINDEX, MODE_SUPERDELDIR, MODE_DELDIR, and MODE_LARGEFILE.
License
LGPL-3.0-or-later