2 releases
0.1.1 | Aug 11, 2024 |
---|---|
0.1.0 | Aug 1, 2024 |
#416 in Filesystem
29 downloads per month
30KB
749 lines
dtools
A Rust-based command-line utility for manipulating Commodore 64 D64 disk images, offering a Rust library to use in other projects.
Features
- Create and format D64 images (35 or 40 tracks)
- List, extract, and insert files
- Read and write individual sectors
- Manage Block Availability Map (BAM)
- PETSCII/ASCII conversion
Building
Requires Rust 1.54 or later.
cargo build --release
The binary will be in target/release/dtools
.
Usage
Create a new D64 image
dtools create -f newdisk.d64 -t 35
Format a D64 image
dtools format -f mydisk.d64 -n "MY DISK" -i "01"
List files on a D64 image
dtools list -f mydisk.d64
Insert a file
dtools insert -f mydisk.d64 -n "MYFILE" -i /path/to/input/file
Extract a file
dtools extract -f mydisk.d64 -n "MYFILE" -o /path/to/output/file
Read a sector
dtools read -f mydisk.d64 -t 18 -s 0
Write to a sector
dtools write -f mydisk.d64 -t 18 -s 0 -d "0123456789ABCDEF"
Show BAM
dtools show-bam -f mydisk.d64
Find a free sector
dtools find-free-sector -f mydisk.d64
Library Usage
dtools
can also be used as a library in other Rust projects:
use d64lib::{D64, D64Error};
fn main() -> Result {
let mut d64 = D64::from_file("mydisk.d64")?;
let files = d64.list_files()?;
println!("Files on disk: {:?}", files);
Ok(())
}
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
Dependencies
~1.2–1.8MB
~34K SLoC