# hadris-cd
A Rust library for creating hybrid ISO+UDF optical disc images (UDF Bridge format).
## Overview
This crate creates images that contain both ISO 9660 and UDF filesystems sharing the same underlying file data. This provides maximum compatibility:
- Legacy systems read ISO 9660
- Modern systems read UDF
- Both filesystems point to the same file data on disk
## Quick Start
```rust,no_run
use hadris_cd::{OpticalImageWriter, OpticalImageOptions, FileTree, FileEntry};
let mut tree = FileTree::new();
tree.add_file(FileEntry::from_buffer("readme.txt", b"Hello, World!".to_vec()));
let options = OpticalImageOptions::default()
.volume_id("MY_DISC")
.joliet(hadris_cd::JolietLevel::Level3);
let file = std::fs::File::create("output.iso").unwrap();
OpticalImageWriter::new(file, options)
.finish(tree)
.unwrap();
```
## Disk Layout
The UDF Bridge format interleaves ISO 9660 and UDF structures:
```text
Sector 0-15: System area (boot code, partition tables)
Sector 16-...: ISO 9660 Volume Descriptors
Sector 17-19: UDF Volume Recognition Sequence (BEA01, NSR02, TEA01)
Sector 256: UDF Anchor Volume Descriptor Pointer
Sector 257+: UDF Volume Descriptor Sequence
File data: Shared between ISO and UDF (both point to same sectors)
```
## Features
- **ISO 9660** with Joliet (Windows long filenames) and Rock Ridge (POSIX)
- **UDF 1.02/1.50/2.00+** support
- **El-Torito** bootable images (BIOS and UEFI)
- **Hybrid MBR+GPT** for USB booting
Hybrid image creation currently delegates to the synchronous ISO and UDF
writers. The crate therefore exposes a sync-only writer API. Its default features
select both `std` and `sync` explicitly.
## License
MIT