#[repr(C)]pub struct Statx { /* private fields */ }
Expand description
statx()
file informations representation.
Implementations§
Source§impl Statx
impl Statx
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 attributes(&self) -> u64
pub const fn attributes(&self) -> u64
Returns further status information about the file (see below for more information).
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 attributes_mask(&self) -> StatXAttr
pub const fn attributes_mask(&self) -> StatXAttr
A mask indicating which bits in stx_attributes are supported by the VFS and the filesystem.
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.
Sourcepub const fn dev_minor(&self) -> u32
pub const fn dev_minor(&self) -> u32
Returns the minor device on which this file (inode) resides.
Sourcepub const fn mount_id(&self) -> u64
pub const fn mount_id(&self) -> u64
The mount ID of the mount containing the file. This is the same number reported by name_to_handle_at(2) and corresponds to the number in the first field in one of the records in /proc/self/mountinfo.
Sourcepub const fn dio_mem_align(&self) -> u32
pub const fn dio_mem_align(&self) -> u32
Returns the alignment (in bytes) required for user memory buffers for direct I/O (O_DIRECT) on this file, or 0 if direct I/O is not supported on this file.
STATX_DIOALIGN (stx_dio_mem_align and stx_dio_offset_align) is supported on block devices since Linux 6.1. The support on regular files varies by filesystem; it is supported by ext4, f2fs, and xfs since Linux 6.1.
Sourcepub const fn dio_offset_align(&self) -> u32
pub const fn dio_offset_align(&self) -> u32
Returns the alignment (in bytes) required for file offsets and I/O segment lengths for direct I/O (O_DIRECT) on this file, or 0 if direct I/O is not supported on this file. This will only be nonzero if stx_dio_mem_align is nonzero, and vice versa.