What is this?
Usage
use iso9660_core::{ISO9660, iso9660entry::IsISO9660Record};
use std::fs::File;
fn main() -> iso9660_core::ISOResult<()> {
let iso_path = "example.iso";
let file = File::open(iso_path)?;
let mut fs = ISO9660::load(file)?;
let mut iter = fs.listdir("/")?;
println!("Root directory:");
while let Some(entry) = iter.next(&mut fs) {
let entry = entry?;
println!(" {}", entry.identifier());
}
let mut buffer = vec![0u8; 1024]; let bytes_read = fs.read("README.TXT", &mut buffer, 0)?;
println!("Read {} bytes from README.TXT", bytes_read);
let total_size = fs.total_size("README.TXT")?;
println!("Total size of README.TXT: {} bytes", total_size);
#[cfg(feature = "std")]
fs.print_tree();
Ok(())
}
Tests
The tests require genisoimage to be installed. Run with:
cargo test --features std
To run all tests:
cargo test --features std -- --include-ignored
(includes a test which runs longer and also needs ~5GB of free disk space to build the ISO)
Links