mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
c69bf18be8
commit
cebb1c1312
1 changed files with 3 additions and 2 deletions
|
|
@ -99,10 +99,11 @@ pub fn permissions(_: Permissions) -> Option<String> { None }
|
|||
// Convert a file mode to a string representation
|
||||
#[cfg(unix)]
|
||||
#[allow(clippy::collapsible_else_if)]
|
||||
pub fn permissions(m: u16) -> Option<String> {
|
||||
use libc::{S_IFBLK, S_IFCHR, S_IFDIR, S_IFIFO, S_IFLNK, S_IFMT, S_IFSOCK, S_IRGRP, S_IROTH, S_IRUSR, S_ISGID, S_ISUID, S_ISVTX, S_IWGRP, S_IWOTH, S_IWUSR, S_IXGRP, S_IXOTH, S_IXUSR};
|
||||
pub fn permissions(mode: u16) -> Option<String> {
|
||||
use libc::{mode_t, S_IFBLK, S_IFCHR, S_IFDIR, S_IFIFO, S_IFLNK, S_IFMT, S_IFSOCK, S_IRGRP, S_IROTH, S_IRUSR, S_ISGID, S_ISUID, S_ISVTX, S_IWGRP, S_IWOTH, S_IWUSR, S_IXGRP, S_IXOTH, S_IXUSR};
|
||||
|
||||
let mut s = String::with_capacity(10);
|
||||
let m = mode as mode_t;
|
||||
|
||||
// File type
|
||||
s.push(match m & S_IFMT {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue