mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Fix Windows
This commit is contained in:
parent
069ff689c8
commit
23cd9a087c
1 changed files with 5 additions and 3 deletions
|
|
@ -141,20 +141,22 @@ impl Cha {
|
|||
|
||||
#[inline]
|
||||
pub fn new_nofollow(path: &Path, meta: Metadata) -> Self {
|
||||
let mut cha = Self::from(meta);
|
||||
let mut attached = ChaKind::empty();
|
||||
|
||||
#[cfg(unix)]
|
||||
if Urn::new(path).is_hidden() {
|
||||
cha.kind |= ChaKind::HIDDEN;
|
||||
attached |= ChaKind::HIDDEN;
|
||||
}
|
||||
#[cfg(windows)]
|
||||
{
|
||||
use std::os::windows::fs::MetadataExt;
|
||||
if meta.file_attributes() & 2 != 0 {
|
||||
cha.kind |= ChaKind::HIDDEN;
|
||||
attached |= ChaKind::HIDDEN;
|
||||
}
|
||||
}
|
||||
|
||||
let mut cha = Self::from(meta);
|
||||
cha.kind |= attached;
|
||||
cha
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue