Expand description
cdfs
cdfs
is a portable, userland implementation of the ISO 9660 / ECMA-119 filesystem typically found on CDs and DVDs.
Usage
To open an ISO image:
use cdfs::{DirectoryEntry, ISO9660};
let file = File::open("images/test.iso")?;
let iso = ISO9660::new(file)?;
To read a file:
let mut contents = Vec::new();
if let Some(DirectoryEntry::File(file)) = iso.open("README.md")? {
file.read().read_to_end(&mut contents)?;
}
To iterate over items in a directory:
if let Some(DirectoryEntry::Directory(dir)) = iso.open("/tmp")? {
for entry in dir.contents() {
println!("{}", entry?.identifier());
}
}
To get information about a file:
let file = File::open("images/test.iso")?;
let iso = ISO9660::new(file)?;
let obj = iso.open("GPL_3_0.TXT")?.expect("GPL_3_0.TXT doesn't exist");
println!("Last modified at: {:?}", obj.modify_time());
See Also
The examples.
Structs
- Holds information from system use (SUSP) entries.
- Struct representing an ISO 9660 / ECMA-119 filesystem.
DirectoryEntry
for directories.DirectoryEntry
for regular files.- A struct providing read-only access to a file on the filesystem.
- POSIX.1 attributes from a
PX
entry. - The mode from a
PX
entry. Equivalent to POSIX.1’sst_mode
field. - Timestamps from a
TF
entry. DirectoryEntry
for symbolic links. Typically generated fromSL
entries.
Enums
- An entry inside of a directory on the filesystem. Returned by the
ISODirectoryIterator
iterator. - The master error structure.
- System Use extensions registered as being used in a directory hierarchy
Constants
- The size of a filesystem block, currently hardcoded to 2048 although the ISO spec allows for other sizes.
Traits
- A quick hack to allow for a constructor even though blocks are defined as a primitive type.
ExtraAttributes
encapsulates various metadata specified by ISO-9660 / ECMA-119 extensions.- A trait for objects which can be read by logical block addresses.
Type Aliases
- A
u8
array big enough to hold an entire filesystem block.