pub struct FileAttr {Show 13 fields
pub ino: INum,
pub size: u64,
pub blocks: u64,
pub atime: SystemTime,
pub mtime: SystemTime,
pub ctime: SystemTime,
pub kind: SFlag,
pub perm: u16,
pub nlink: u32,
pub uid: u32,
pub gid: u32,
pub rdev: u32,
pub version: u64,
}Expand description
File attributes
Fields§
§ino: INumInode number
size: u64Size in bytes
blocks: u64Size in blocks
atime: SystemTimeTime of last access
mtime: SystemTimeTime of last modification
ctime: SystemTimeTime of last change
kind: SFlagKind of file (directory, file, pipe, etc)
perm: u16Permissions
nlink: u32Number of hard links
uid: u32User id
gid: u32Group id
rdev: u32Rdev
version: u64Version
Implementations§
Source§impl FileAttr
impl FileAttr
Sourcepub fn check_perm(
&self,
uid: u32,
gid: u32,
access_mode: u8,
) -> AsyncFusexResult<()>
pub fn check_perm( &self, uid: u32, gid: u32, access_mode: u8, ) -> AsyncFusexResult<()>
File permissions in Unix/Linux systems are represented as a 12-bit structure, laid out as follows: ┌───────────────┬─────────┬─────────┬─────────┐ │ Special │ User │ Group │ Other │ ├───────────────┼─────────┼─────────┼─────────┤ │ 3 Bits │ 3 Bits │ 3 Bits │ 3 Bits │ ├───────────────┼─────────┼─────────┼─────────┤ │ suid|sgid|stky│ r w x │ r w x │ r w x │ └──────┬───────┴────┬────┴────┬────┴────┬────┘ │ │ │ │ │ │ │ └─ Other: Read, Write, Execute permissions for other users. │ │ └─ Group: Read, Write, Execute permissions for group members. │ └─ User: Read, Write, Execute permissions for the owner of the file. └─ Special: Set User ID (suid), Set Group ID (sgid), and Sticky Bit (stky). When Sticky Bit set on a directory, files in that directory may only be unlinked or - renamed by root or the directory owner or the file owner.