Skip to main content

Crate hadris_udf

Crate hadris_udf 

Source
Expand description

§Hadris UDF

A pure Rust Universal Disk Format (UDF) filesystem library for optical media and disk images. It supports hosted applications and no_std bootloaders, kernels, firmware, and embedded systems.

UDF (ECMA-167) is the filesystem used for:

  • DVD-ROM, DVD-Video, DVD-RAM
  • Blu-ray discs
  • Large USB drives (files >4GB)
  • Packet writing to CD/DVD-RW

§Features

This crate supports:

  • UDF 1.02: DVD-ROM (read-only)
  • UDF 1.50: DVD-RAM, packet writing (planned)
  • UDF 2.01: DVD-RW, streaming (planned)

§Quick Start

use std::fs::File;
use std::io::BufReader;
use hadris_udf::UdfVolume;

// Open a UDF image file
let file = File::open("movie.udf").unwrap();
let reader = BufReader::new(file);
let udf = UdfVolume::open(reader).unwrap();

// Read volume info
let info = udf.info();
println!("Volume: {}", info.volume_id);

// List root directory
let root = udf.root_dir().unwrap();
for entry in root.entries() {
    println!("{} ({})", entry.name(), entry.size);
}

// Read a file's contents
let bytes = udf.read_file(&entry).unwrap();

§Feature Flags

FeatureDescription
readRead support (default)
allocHeap allocation without full std
stdFull standard library support
writeWrite/format support (requires std)
syncSynchronous API under sync (default)
asyncAsynchronous read API under hadris_udf::r#async

std does not select an I/O mode. The write implementation is currently synchronous-only; enabling write and async together does not expose an async write API.

§Known Limitations

  • Extended allocation descriptors and stream directories are not supported.
  • Packet writing / sparing tables / Blu-ray-specific features are not implemented.
  • Directory listing reads each file ICB to populate dir::UdfDirEntry::size (one extra seek per file).

§Specification References

  • ECMA-167: Volume and File Structure for Write-Once and Rewritable Media
  • OSTA UDF Specification (udf260.pdf)

Re-exports§

pub use sync::*;sync

Modules§

asyncasync
Asynchronous UDF filesystem API.
syncsync
Synchronous UDF filesystem API.

Structs§

UdfRevision
UDF revision numbers
UdfTimestamp
UDF timestamp structure

Enums§

Error
Errors that can occur when reading or writing UDF filesystems

Constants§

AVDP_LOCATION
Location of the first Anchor Volume Descriptor Pointer
SECTOR_SIZE
Sector size for UDF (always 2048 bytes for optical media)

Type Aliases§

Result
Result type for UDF operations