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§
- Extra
Meta - Holds information from system use (SUSP) entries.
- ISO9660
- Struct representing an ISO 9660 / ECMA-119 filesystem.
- ISODirectory
DirectoryEntry
for directories.- ISODirectory
Iterator - Iterator for the contents of
ISODirectory
constructed bycontents()
. Similar to POSIX.1’sreaddir
. - ISOFile
DirectoryEntry
for regular files.- ISOFile
Reader - A struct providing read-only access to a file on the filesystem.
- Posix
Attributes - POSIX.1 attributes from a
PX
entry. - Posix
File Mode - The mode from a
PX
entry. Equivalent to POSIX.1’sst_mode
field. - Posix
Timestamp - Timestamps from a
TF
entry. - Symlink
DirectoryEntry
for symbolic links. Typically generated fromSL
entries.
Enums§
- Directory
Entry - An entry inside of a directory on the filesystem. Returned by the
ISODirectoryIterator
iterator. - ISOError
- The master error structure.
- Susp
Extension - System Use extensions registered as being used in a directory hierarchy
Constants§
- BLOCK_
SIZE - The size of a filesystem block, currently hardcoded to 2048 although the ISO spec allows for other sizes.
Traits§
- Block
Buffer Ctor - A quick hack to allow for a constructor even though blocks are defined as a primitive type.
- Extra
Attributes ExtraAttributes
encapsulates various metadata specified by ISO-9660 / ECMA-119 extensions.- ISO9660
Reader - A trait for objects which can be read by logical block addresses.
Type Aliases§
- Block
Buffer - A
u8
array big enough to hold an entire filesystem block. - Result
Result
that returns anISOError
.