mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
cebb1c1312
commit
c6b39e2e9f
2 changed files with 4 additions and 4 deletions
|
|
@ -26,7 +26,7 @@ pub struct Cha {
|
|||
pub created: Option<SystemTime>,
|
||||
pub modified: Option<SystemTime>,
|
||||
#[cfg(unix)]
|
||||
pub permissions: u16,
|
||||
pub permissions: u32,
|
||||
}
|
||||
|
||||
impl From<Metadata> for Cha {
|
||||
|
|
@ -63,7 +63,7 @@ impl From<Metadata> for Cha {
|
|||
#[cfg(unix)]
|
||||
permissions: {
|
||||
use std::os::unix::prelude::PermissionsExt;
|
||||
m.permissions().mode() as u16
|
||||
m.permissions().mode()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,12 +94,12 @@ pub fn copy_with_progress(from: &Path, to: &Path) -> mpsc::Receiver<Result<u64,
|
|||
// Convert a file mode to a string representation
|
||||
#[cfg(windows)]
|
||||
#[allow(clippy::collapsible_else_if)]
|
||||
pub fn permissions(_: Permissions) -> Option<String> { None }
|
||||
pub fn permissions(_: u32) -> Option<String> { None }
|
||||
|
||||
// Convert a file mode to a string representation
|
||||
#[cfg(unix)]
|
||||
#[allow(clippy::collapsible_else_if)]
|
||||
pub fn permissions(mode: u16) -> Option<String> {
|
||||
pub fn permissions(mode: u32) -> 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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue