Skip to content

Commit

Permalink
fix: broaden file watcher event types to accommodate permission chang…
Browse files Browse the repository at this point in the history
…es on certain platforms (#1024)
  • Loading branch information
sxyazi committed May 11, 2024
1 parent 6ff42c1 commit eed82c1
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions yazi-core/src/manager/watcher.rs
@@ -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};
Expand All @@ -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();
}
Expand Down

0 comments on commit eed82c1

Please sign in to comment.