mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Bitwise mode check
This commit is contained in:
parent
71880a6dcd
commit
46fea7eafb
1 changed files with 1 additions and 5 deletions
|
|
@ -50,11 +50,7 @@ impl Filetype {
|
|||
return false;
|
||||
};
|
||||
|
||||
let mode_bin = format!("{:b}", metadata.permissions().mode());
|
||||
return mode_bin.len() == 16 && match *mode_bin.as_bytes() {
|
||||
[.., _, _, a, _, _, b, _, _, c] => a == b'1' || b == b'1' || c == b'1',
|
||||
_ => false,
|
||||
}
|
||||
metadata.permissions().mode() & 0o100111 > 0o100000
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue