pub struct FileAttributes {
pub file_type: FileType,
pub unused_bit: bool,
pub save_with_replace_flag: bool,
pub locked_flag: bool,
pub closed_flag: bool,
}Expand description
We introduce the term “file attributes” to refer to the full 8-bit directory entry field which contains the file type along with several flags.
Fields§
§file_type: FileTypeBits 0-3 indicate the file type.
unused_bit: boolBit 4 is unused, but we store it anyway so we can reproduce this field verbatim.
save_with_replace_flag: boolBit 5 is the “save with replace” flag.
locked_flag: boolBit 6 is the “locked” flag, indicated by a “>” in directory listings.
closed_flag: boolBit 7 is the “closed” flag. Files are normally closed, so this bit is normally set. Unclosed files are indicated in directory listings with a “*”, leading to such files being known as “splat files”.
Implementations§
Source§impl FileAttributes
impl FileAttributes
Sourcepub fn from_byte(byte: u8) -> FileAttributes
pub fn from_byte(byte: u8) -> FileAttributes
Parse a byte into a FileAttributes struct.
Sourcepub fn is_scratched(&self) -> bool
pub fn is_scratched(&self) -> bool
Return true if this entry represents a properly deleted (“scratched”) file. That is, if its file type is DEL and the closed flag is not set.
Trait Implementations§
Source§impl Clone for FileAttributes
impl Clone for FileAttributes
Source§fn clone(&self) -> FileAttributes
fn clone(&self) -> FileAttributes
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileAttributes
impl Debug for FileAttributes
Auto Trait Implementations§
impl Freeze for FileAttributes
impl RefUnwindSafe for FileAttributes
impl Send for FileAttributes
impl Sync for FileAttributes
impl Unpin for FileAttributes
impl UnwindSafe for FileAttributes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more