pub struct AffsReaderVar<'a, D: SectorDevice> { /* private fields */ }Expand description
Variable block size AFFS reader.
This reader supports AFFS filesystems with block sizes from 512 to 8192 bytes, as used on Amiga hard disk partitions. The block size is determined by probing the root block at different sizes until the checksum validates.
Implementations§
Source§impl<'a, D: SectorDevice> AffsReaderVar<'a, D>
impl<'a, D: SectorDevice> AffsReaderVar<'a, D>
Sourcepub fn new(device: &'a D, total_sectors: u64) -> Result<Self, AffsError>
pub fn new(device: &'a D, total_sectors: u64) -> Result<Self, AffsError>
Create a new variable block size AFFS reader.
This probes the filesystem to determine the block size by trying different block sizes until the root block checksum validates.
§Arguments
device- Sector device to read fromtotal_sectors- Total number of 512-byte sectors on the device
Sourcepub const fn root_block(&self) -> u32
pub const fn root_block(&self) -> u32
Get the root block number.
Sourcepub const fn total_blocks(&self) -> u32
pub const fn total_blocks(&self) -> u32
Get the total number of blocks.
Sourcepub const fn block_size(&self) -> usize
pub const fn block_size(&self) -> usize
Get the block size in bytes.
Sourcepub const fn log_blocksize(&self) -> u8
pub const fn log_blocksize(&self) -> u8
Get the log2 block size (relative to 512).
Sourcepub fn disk_name_str(&self) -> Option<&str>
pub fn disk_name_str(&self) -> Option<&str>
Get the disk name (volume label) as a string (if valid UTF-8).
Sourcepub fn label_str(&self) -> Option<&str>
pub fn label_str(&self) -> Option<&str>
Get the volume label as string (alias for disk_name_str).
Sourcepub const fn creation_date(&self) -> AmigaDate
pub const fn creation_date(&self) -> AmigaDate
Get the volume creation date.
Sourcepub const fn last_modified(&self) -> AmigaDate
pub const fn last_modified(&self) -> AmigaDate
Get the volume last modification date.
Sourcepub fn mtime(&self) -> i64
pub fn mtime(&self) -> i64
Get the volume modification time as Unix timestamp.
This matches GRUB’s grub_affs_mtime() behavior:
- days * 86400 + min * 60 + hz / 50 + epoch offset
Sourcepub const fn hash_table_size(&self) -> u32
pub const fn hash_table_size(&self) -> u32
Get the hash table size.
Sourcepub fn read_root_dir(&self) -> Result<VarDirIter<'_, D>, AffsError>
pub fn read_root_dir(&self) -> Result<VarDirIter<'_, D>, AffsError>
Iterate over entries in the root directory.