Expand description
UDF (Universal Disk Format) — detection and file-entry traversal.
UDF bridge discs carry both ISO 9660 and UDF structures on the same sectors. The UDF recognition sequence starts at sector 16: each Volume Structure Descriptor is 2048 bytes with a 5-byte identifier at bytes 1-5.
Identifiers: “BEA01” (Extended Area Descriptor), “NSR02” or “NSR03” (OSTA CS0 UDF mark), “TEA01” (Terminating Extended Area Descriptor). NSR02/NSR03 presence is the definitive UDF indicator.
§Full UDF traversal
Descriptor chain: AVDP (LBA 256) → VDS → Partition Descriptor (partition start LBA) + Logical Volume Descriptor (FSD location) → File Set Descriptor (root dir FE LBA) → File Entry → File Identifier Descriptors.
All physical LBAs satisfy: phys_lba = partition_start + logical_block_num.
Re-exports§
pub use xattr::parse_extended_attributes;pub use xattr::UdfEaKind;pub use xattr::UdfExtendedAttribute;
Modules§
- xattr
- UDF extended attributes (ECMA-167 4/14.10).
Structs§
- UdfFile
Entry - A single entry returned by UDF directory traversal.
- UdfState
Enums§
- UdfPartition
Kind - The kind of partition referenced by the UDF logical volume’s file set.
Constants§
- MAX_
BLOCK_ SIZE - Largest logical block size we read into a stack sector buffer.
- TAG_
AVDP - TAG_EFE
- TAG_FE
- TAG_
FE_ ALT - Some UDF implementations (e.g. older genisoimage) write 261 for File Entry.
- TAG_FID
- TAG_FSD
- TAG_LVD
- TAG_PD
- TAG_
TERM
Functions§
- decode_
symlink_ target - Decode a UDF symbolic link’s
PATH_COMPONENTrecord chain (ECMA-167 4/14.16.2, OSTA UDF 2.01 §2.2.8) into its target path, following the Linux kernel’sudf_pc_to_charsemantics (fs/udf/symlink.c): - descriptor_
label - Human-readable label for a descriptor tag identifier, or
Nonefor an identifier this crate does not recognise (so the caller does not validate a non-descriptor sector). - detect_
udf - True if the image has a UDF recognition sequence (NSR02 or NSR03).
- ecma167_
crc - The ECMA-167 descriptor CRC (3/7.2): CRC-CCITT with polynomial
0x1021, initial value0x0000, no input/output reflection and no final XOR, computed over the descriptor body (the bytes after the 16-byte tag). - fe_
modification_ time - The Modification Time of a File Entry sector (
is_efeselects the Extended File Entry layout, whose extra Object Size + Creation Time fields shift the timestamps): base FE modification time is at offset 84, EFE at offset 92. - fe_
slack_ nonzero - Count the non-zero bytes in a File Entry’s final-block slack — the unused
tail of the last logical block after
InformationLength, since a file occupies whole logical blocks. - fsd_
recording_ time - Read the File Set Descriptor’s recording time (4/14.1, offset 16) from the
FSD at
fsd_lba.Ok(None)when the sector is not an FSD or the time is unset. - parse_
udf_ state - Try to parse the AVDP → VDS → FSD chain, returning state needed for
directory traversal. Returns
Noneif the image lacks a valid UDF structure. - parse_
udf_ state_ checked - Parse the AVDP → VDS → FSD bootstrap chain, distinguishing a real read failure from a structural negative.
- read_
dir_ at_ lba - Read all non-parent File Identifier Descriptors from the directory whose
File Entry resides at
dir_fe_lba, returning oneUdfFileEntryper child. - read_
fe_ data - Read the data extent of the File Entry at
fe_lba. - read_
fe_ extended_ attributes - Read the extended attributes of the File Entry at
fe_lba. - seek_
read_ checked - Seek to
byte_posand read exactlybuf.len()bytes, propagating the realio::Error(a truncated image yieldsio::ErrorKind::UnexpectedEof). - tag_
checksum - The ECMA-167 descriptor-tag checksum (3/7.2): the mod-256 sum of the 16 tag bytes excluding byte 4 (the checksum field itself).