Skip to content

Commit bc7fcb5

Browse files
committed
Merge branch 'master' of github.com:SoptikHa2/desed into master
2 parents 2032f09 + bc17f54 commit bc7fcb5

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ cfg-if = "0.1.10"
2727
inotify = "0.8.3" # Watch files and auto-reload on changes
2828

2929
[target.'cfg(any(target_os="darwin", target_os="dragonfly", target_os="freebsd", target_os="netbsd", target_os="openbsd"))'.dependencies]
30-
kqueue = "0.2.3" # Watch files and auto-reload on changes
30+
kqueue = "1.0.1" # Watch files and auto-reload on changes

src/file_watcher/kqueue.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use std::vec::Vec;
55

66
extern crate kqueue;
77
use kqueue::Watcher as KQueue;
8+
use kqueue::FilterFlag as FilterFlag;
89

910
const FILTER: kqueue::EventFilter = kqueue::EventFilter::EVFILT_VNODE;
1011

@@ -31,7 +32,12 @@ impl FileWatcherImpl {
3132
}
3233

3334
pub fn add_watch(&mut self, file_path: &PathBuf) -> Result<&FileWatchImpl> {
34-
let flags: kqueue::FilterFlag = kqueue::NOTE_WRITE | kqueue::NOTE_EXTEND;
35+
let flags: FilterFlag =
36+
FilterFlag::NOTE_WRITE |
37+
FilterFlag::NOTE_EXTEND |
38+
FilterFlag::NOTE_RENAME |
39+
FilterFlag::NOTE_DELETE |
40+
FilterFlag::NOTE_LINK;
3541

3642
let file = File::open(file_path)?;
3743
let _ = match self.kq.add_file(&file, FILTER, flags) {

0 commit comments

Comments
 (0)