hadris-udf
A pure Rust Universal Disk Format (UDF) filesystem library for optical media
and disk images, with std and no_std support. It is suitable for desktop
image tools, 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), and packet writing to CD/DVD-RW.
Features
- Read UDF 1.02 images (DVD-ROM)
- Write/format UDF filesystems from scratch
- no_std compatible (with
alloc) - Descriptor-level access for building hybrid images
Quick Start
[]
= "2.1.0"
use File;
use BufReader;
use UdfVolume;
let file = open.unwrap;
let reader = new;
let udf = open.unwrap;
let info = udf.info;
println!;
for entry in udf.root_dir.unwrap.entries
Writing a UDF image
Enable the writer explicitly:
[]
= { = "2.1.0", = ["write"] }
use ;
use Cursor;
let mut buffer = vec!;
let mut cursor = new;
let mut root = new;
root.add_file;
let options = default;
let output = create.expect;
let _cursor = output.into_inner;
Feature Flags
| Feature | Default | Description |
|---|---|---|
read |
Yes | Read support |
alloc |
No | Heap allocation without full std |
std |
Yes | Full standard library support |
write |
No | Mastered image creation; requires std, alloc, and read |
sync |
Yes | Synchronous filesystem API |
async |
No | Asynchronous filesystem API |
std and the I/O mode are independent. Default features select std, read,
and sync; custom builds may select sync, async, or both.
UDF scope
The reader and writer support mastered, read-only Type-1 images. The writer can label output as UDF 1.02, 1.50, 2.00, 2.01, 2.50, or 2.60 and emits the matching NSR identifier. This does not implement the rewritable-media features often associated with those revisions, such as packet writing, VAT, sparing tables, metadata partitions, or pseudo-overwrite.
Use the oldest mastered revision accepted by the target consumers and validate the result with those consumers.
Documentation
Specifications
- ECMA-167: Volume and File Structure for Write-Once and Rewritable Media
- OSTA UDF Specification (udf260.pdf)
License
Licensed under the MIT license.