pub struct FileEntry { /* private fields */ }Expand description
Metadata for a file or subdirectory entry.
Implementations§
Source§impl FileEntry
impl FileEntry
Sourcepub fn name(&self) -> Cow<'_, str>
pub fn name(&self) -> Cow<'_, str>
Get the file’s display name.
Returns the long filename if available, otherwise the short name. The
Cow is borrowed for short names and owned (allocated) for long names,
since long names are stored internally as UTF-16 and require decoding
before they can be exposed as a &str.
Requires the alloc feature. Without alloc, use Self::short_name
and Self::long_name (with LongFileName::chars /
LongFileName::eq_str) directly.
Sourcepub fn short_name(&self) -> &ShortFileName
pub fn short_name(&self) -> &ShortFileName
Get the short (8.3) filename, in its canonical on-disk (uppercase) form.
Use Self::nt_case with ShortFileName::with_nt_case to recover the
original lowercase presentation without allocating.
Sourcepub fn nt_case(&self) -> NtCaseFlags
pub fn nt_case(&self) -> NtCaseFlags
Windows NT 8.3 name case flags (DIR_NTRes) for this entry.
Records whether the short name’s base and/or extension were originally lowercase. Meaningful only when the entry has no long file name.
Sourcepub fn long_name(&self) -> Option<&LongFileName>
pub fn long_name(&self) -> Option<&LongFileName>
Get the long filename, if available
Sourcepub fn attributes(&self) -> DirEntryAttrFlags
pub fn attributes(&self) -> DirEntryAttrFlags
Get the file attributes
Sourcepub fn is_directory(&self) -> bool
pub fn is_directory(&self) -> bool
Check if this entry is a directory
Sourcepub fn created(&self) -> FatDateTime
pub fn created(&self) -> FatDateTime
Creation timestamp (date + time + 10-ms units).
Sourcepub fn accessed_date(&self) -> u16
pub fn accessed_date(&self) -> u16
Last-access date. FAT does not store an access time, only a date.
Returns the raw FAT-encoded date (year-1980)<<9 | month<<5 | day.
Sourcepub fn modified(&self) -> FatDateTime
pub fn modified(&self) -> FatDateTime
Last-modified timestamp (date + time; sub-2-second precision is not preserved by FAT for the modified field).