mirror of
https://github.com/sxyazi/yazi.git
synced 2024-09-11 10:26:35 +03:00
fix: broaden file watcher event types to accommodate permission changes on certain platforms (#1024)
This commit is contained in:
parent
6ff42c1a6d
commit
eed82c1386
@ -1,7 +1,7 @@
|
||||
use std::{collections::{HashMap, HashSet}, time::{Duration, SystemTime}};
|
||||
|
||||
use anyhow::Result;
|
||||
use notify::{event::{MetadataKind, ModifyKind}, EventKind, RecommendedWatcher, RecursiveMode, Watcher as _Watcher};
|
||||
use notify::{RecommendedWatcher, RecursiveMode, Watcher as _Watcher};
|
||||
use parking_lot::RwLock;
|
||||
use tokio::{fs, pin, sync::{mpsc::{self, UnboundedReceiver}, watch}};
|
||||
use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt};
|
||||
@ -28,24 +28,6 @@ impl Watcher {
|
||||
let watcher = RecommendedWatcher::new(
|
||||
move |res: Result<notify::Event, notify::Error>| {
|
||||
let Ok(event) = res else { return };
|
||||
|
||||
match event.kind {
|
||||
EventKind::Create(_) => {}
|
||||
EventKind::Modify(kind) => match kind {
|
||||
ModifyKind::Data(_) => {}
|
||||
ModifyKind::Metadata(md) => match md {
|
||||
MetadataKind::WriteTime => {}
|
||||
MetadataKind::Permissions => {}
|
||||
MetadataKind::Ownership => {}
|
||||
_ => return,
|
||||
},
|
||||
ModifyKind::Name(_) => {}
|
||||
_ => return,
|
||||
},
|
||||
EventKind::Remove(_) => {}
|
||||
_ => return,
|
||||
}
|
||||
|
||||
for path in event.paths {
|
||||
out_tx.send(Url::from(path)).ok();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user