mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01:05 +00:00
fix: trust directory stats outside of Linux and macOS (#3528)
Co-authored-by: sxyazi <sxyazi@gmail.com>
This commit is contained in:
parent
30ac041d9e
commit
c6e1702c61
2 changed files with 6 additions and 3 deletions
|
|
@ -14,8 +14,9 @@ pub struct Partition {
|
|||
}
|
||||
|
||||
impl Partition {
|
||||
// Match mount types that do not reliably emit change notifications, or update directory
|
||||
// metadata on changes, and should be refreshed frequently / heuristically.
|
||||
// Match mount types that do not reliably emit change notifications, or do not
|
||||
// update directory metadata on changes, and should be refreshed frequently /
|
||||
// heuristically.
|
||||
pub fn heuristic(&self) -> bool {
|
||||
let b: &[u8] = self.fstype.as_ref().map_or(b"", |s| s.as_encoded_bytes());
|
||||
matches!(b, b"exfat" | b"fuse.rclone")
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@ impl Partitions {
|
|||
}
|
||||
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
|
||||
{
|
||||
true
|
||||
// For now, assume other targets update directory stat data correctly & do not
|
||||
// need heuristic polling.
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue