iso9660_core

Crates.ioiso9660_core
lib.rsiso9660_core
version0.1.0
created_at2025-12-21 22:27:17.140792+00
updated_at2025-12-21 22:27:17.140792+00
descriptionRead-only ISO9660 crate for no_std environments (WIP)
homepage
repositoryhttps://github.com/Mathis-Z/iso9660_core
max_upload_size
id1998682
size58,354
Mathis Zscheischler (Mathis-Z)

documentation

README

What is this?

  • work in progress implementation of the ISO9660 filesystem (read-only)
  • works in no_std and without alloc
  • support for multi-extent (e.g, >4GB) files
  • support for extensions

Usage

use iso9660_core::{ISO9660, iso9660entry::IsISO9660Record};
use std::fs::File;

fn main() -> iso9660_core::ISOResult<()> {
    // Open an existing ISO file
    let iso_path = "example.iso";
    let file = File::open(iso_path)?;
    let mut fs = ISO9660::load(file)?;

    // List the root directory
    let mut iter = fs.listdir("/")?;
    println!("Root directory:");
    while let Some(entry) = iter.next(&mut fs) {
        let entry = entry?;
        println!("  {}", entry.identifier());
    }

    // Read a file into a buffer
    let mut buffer = vec![0u8; 1024]; // adjust size as needed
    let bytes_read = fs.read("README.TXT", &mut buffer, 0)?;
    println!("Read {} bytes from README.TXT", bytes_read);

    // Get total size of a file
    let total_size = fs.total_size("README.TXT")?;
    println!("Total size of README.TXT: {} bytes", total_size);

    // Optional: print the directory tree
    #[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

Commit count: 0

cargo fmt