fn permission(&self, op: u16) -> bool {
        let mut perm = self.file_stat.st_mode & 0o7;
        if self.uid == self.file_stat.st_uid {
            // If self.mode is 101100110, >> 6 would be 000000101
            // 0o7 is octal for 111, or, when expanded to 9 digits is 000000111
            perm |= (self.file_stat.st_mode >> 6) & 0o7;
            // Since we erased the GID and OTHER bits when >>6'ing, |= will keep those bits in place.
        }
        if self.gid == self.file_stat.st_gid || self.file_stat.st_gid == 0 {
            perm |= (self.file_stat.st_mode >> 3) & 0o7;
        }
        if self.uid == 0 {
            //set the `other` bits to 111
            perm |= 0o7;
        }
        perm & op == op
    }
/// Tests if the current user has enough permissions to view the file, op is the operation,
/// like read and write, these modes are MODE_EXEC, MODE_READ, and MODE_WRITE
/// Copied from redoxfs
Tests if the current user has enough permissions to view the file, op is the operation,
like read and write, these modes are MODE_EXEC, MODE_READ, and MODE_WRITE
Copied from redoxfs
Tests if the current user has enough permissions to view the file op is the operation like read and write these modes are MODE_EXEC MODE_READ and MODE_WRITE Copied from redoxfs
fn permission(&self, op: u16) -> bool {
        let mut perm = self.file_stat.st_mode & 0o7;
        if self.uid == self.file_stat.st_uid {
            // If self.mode is 101100110, >> 6 would be 000000101
            // 0o7 is octal for 111, or, when expanded to 9 digits is 000000111
            perm |= (self.file_stat.st_mode >> 6) & 0o7;
            // Since we erased the GID and OTHER bits when >>6'ing, |= will keep those bits in place.
        }
        if self.gid == self.file_stat.st_gid || self.file_stat.st_gid == 0 {
            perm |= (self.file_stat.st_mode >> 3) & 0o7;
        }
        if self.uid == 0 {
            //set the `other` bits to 111
            perm |= 0o7;
        }
        perm & op == op
    }
fn permission ( & self , op : u16 ) -> bool { let mut perm = self . file_stat . st_mode & 0o7 ; if self . uid == self . file_stat . st_uid { // If self.mode is 101100110, >> 6 would be 000000101 // 0o7 is octal for 111, or, when expanded to 9 digits is 000000111 perm |= ( self . file_stat . st_mode >> 6 ) & 0o7 ; // Since we erased the GID and OTHER bits when >>6'ing, |= will keep those bits in place. } if self . gid == self . file_stat . st_gid || self . file_stat . st_gid == 0 { perm |= ( self . file_stat . st_mode >> 3 ) & 0o7 ; } if self . uid == 0 { //set the `other` bits to 111 perm |= 0o7 ; } perm & op == op }
Tests if the current user has enough permissions to view the file, op is the operation,
like read and write, these modes are MODE_EXEC, MODE_READ, and MODE_WRITE
Copied from redoxfs
Tests if the current user has enough permissions to view the file op is the operation like read and write these modes are MODE_EXEC MODE_READ and MODE_WRITE Copied from redoxfs
&self
op
u16
&self
op
u16