pub enum Stat {
Stat64(stat),
Statx(Statx),
}
Expand description
Unified Stat structure.
Variants§
Implementations§
Source§impl Stat
impl Stat
Sourcepub const fn block_size(&self) -> i32
pub const fn block_size(&self) -> i32
Returns the “preferred” block size for efficient filesystem I/O. (Writing to a file in smaller chunks may cause an inefficient read-modify-rewrite.)
Sourcepub const fn is_regular(&self) -> bool
pub const fn is_regular(&self) -> bool
Returns true if file type is regular.
Sourcepub const fn is_directory(&self) -> bool
pub const fn is_directory(&self) -> bool
Returns true if file type is directory.
Sourcepub const fn is_character(&self) -> bool
pub const fn is_character(&self) -> bool
Returns true if file type is character.
Sourcepub const fn size(&self) -> i64
pub const fn size(&self) -> i64
Returns the size of the file (if it is a regular file or a symbolic link) in bytes. The size of a symbolic link is the length of the pathname it contains, without a terminating null byte.
Sourcepub const fn blocks(&self) -> i64
pub const fn blocks(&self) -> i64
Returns the number of blocks allocated to the file on the medium, in 512-byte units. (This may be smaller than stx_size/512 when the file has holes.)
Sourcepub const fn rdev_major(&self) -> u32
pub const fn rdev_major(&self) -> u32
Returns the major device that this file (inode) represents if the file is of block or character device type
Sourcepub const fn rdev_minor(&self) -> u32
pub const fn rdev_minor(&self) -> u32
Returns the minor device that this file (inode) represents if the file is of block or character device type
Sourcepub const fn rdev(&self) -> Dev
pub const fn rdev(&self) -> Dev
Returns the device that this file (inode) represents if the file is of block or character device type
Sourcepub const fn dev_major(&self) -> u32
pub const fn dev_major(&self) -> u32
Returns the major device on which this file (inode) resides.