pub struct FileMetadata {Show 19 fields
pub created: String,
pub modified: String,
pub accessed: String,
pub size_in_bytes: u64,
pub is_file_read_only: bool,
pub is_dir: bool,
pub is_file: bool,
pub is_symlink: bool,
pub is_readable: bool,
pub is_writable: bool,
pub is_executable: bool,
pub dev: u64,
pub ino: u64,
pub mode: u32,
pub nlink: u64,
pub uid: u32,
pub gid: u32,
pub blksize: u64,
pub blocks: u64,
/* private fields */
}Fields§
§created: String§modified: String§accessed: String§size_in_bytes: u64§is_file_read_only: bool§is_dir: bool§is_file: bool§is_symlink: bool§is_readable: bool§is_writable: bool§is_executable: bool§dev: u64§ino: u64§mode: u32§nlink: u64§uid: u32§gid: u32§blksize: u64§blocks: u64Implementations§
Source§impl FileMetadata
Methods for FileMetadata, providing functionality to create a new instance
from a file path, retrieve file metadata, and access file size information.
impl FileMetadata
Methods for FileMetadata, providing functionality to create a new instance
from a file path, retrieve file metadata, and access file size information.
§Fields
§Cross-platform
created,modified,accessed— date strings (YYYY-MM-DD)size_in_bytes— raw file size in bytesis_file_read_only,is_dir,is_file,is_symlink— file type flagsis_readable,is_writable,is_executable— permission checks
§Unix only (#[cfg(unix)])
dev— device IDino— inode numbermode— full permission bits (octal)nlink— hard link countuid,gid— owner/group IDsblksize,blocks— filesystem block size and allocated 512-byte blocks
§Windows only (#[cfg(windows)])
file_attributes— Windows attribute flags (hidden, system, archive, etc.)creation_time,last_write_time,last_access_time— raw FILETIME values
§Methods
new(path: &Path) -> Result<Self, String>— construct from a file pathreadable(&self) -> bool— whether the file is readablewritable(&self) -> bool— whether the file is writableexecutable(&self) -> bool— whether the file is executableget_file_in_kilobytes(&self) -> f32— file size in KBget_file_in_megabytes(&self) -> f32— file size in MBget_file_in_gigabytes(&self) -> f32— file size in GBget_file_in_terabytes(&self) -> f32— file size in TB
pub fn new(path: &Path) -> Result<Self, String>
pub fn readable(&self) -> bool
pub fn writable(&self) -> bool
pub fn executable(&self) -> bool
pub fn get_file_in_kilobytes(&self) -> f32
pub fn get_file_in_megabytes(&self) -> f32
pub fn get_file_in_gigabytes(&self) -> f32
pub fn get_file_in_terabytes(&self) -> f32
Auto Trait Implementations§
impl Freeze for FileMetadata
impl RefUnwindSafe for FileMetadata
impl Send for FileMetadata
impl Sync for FileMetadata
impl Unpin for FileMetadata
impl UnsafeUnpin for FileMetadata
impl UnwindSafe for FileMetadata
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