iso9660_simple

Crates.ioiso9660_simple
lib.rsiso9660_simple
version0.1.25
created_at2025-02-19 13:48:18.677933+00
updated_at2025-08-30 01:57:42.517714+00
descriptionISO9660 reading library
homepage
repositoryhttps://github.com/NDRAEY/iso9660_simple
max_upload_size
id1561396
size22,319
(NDRAEY)

documentation

README

ISO9660 Simple

It's a Rust crate that provides minimal ISO9660 images reading and parsing functionality.

To Do

  • Rock Ridge extension support
  • Joliet extension support

Usage

Firstly, add iso9660_simple to your project:

cargo add iso9660_simple

Then, implement reading device trait for your device (it may be a real device, or just a file).

The complete implementation of reading device trait for file looks like this:

use std::fs::File;
use iso9660_simple::Read as ISORead;

struct FileDevice(File);

impl ISORead for FileDevice {
    fn read(&mut self, position: usize, buffer: &mut [u8]) -> Option<()> {
        if self.0.seek(SeekFrom::Start(position as u64)).is_err() {
            return None;
        }

        if self.0.read_exact(buffer).is_ok() {
            Some(())
        } else {
            None
        }
    }
}

Then, you're ready to open the device and make ISO9660 reader from it. For example:

let device = FileDevice(File::open("image.iso").unwrap());
let mut iso = ISO9660::from_device(device);

And now, you can do parse an ISO9660 file:

let root_directory_lba = iso.root().lba.lsb;
let data = iso.read_directory(root_directory_lba);  // Read root directory

let first_file = data.first().unwrap();  // Get first file info

let mut buffer = vec![0u8; first_file.file_size()];
let data = iso.read_file(fist_file, 0, &mut buffer);  // Read the whole file into Vec<u8>.
Commit count: 40

cargo fmt