anotify

Crates.ioanotify
lib.rsanotify
version0.1.3
sourcesrc
created_at2022-10-23 21:19:57.626866
updated_at2022-10-24 03:51:42.534635
descriptionAsync iNotify Filesystem Watcher
homepage
repositoryhttps://github.com/oldwomanjosiah/anotify
max_upload_size
id695388
size34,509
Josiah Hilden (oldwomanjosiah)

documentation

README

aNotify

Async Bindings for the iNotify api

This crate is still a work in progress! The core functionality is there, but it's not all there (and some claimed features are not currently functional), so I wouldn't recommend using it yet. I am open to bug reports though, so if you use it and find any don't hesitate to let me know!

extern crate anotify;
extern crate eyre;

let mut owner = anotify::new()
    .wrap_err("Creating anotify instance")?;

let file_watch = owner.file(PathBuf::from("./readme.md"))?
    .open(true)
    .watch()?;

file_watch.await
    .wrap_err("anoitfy closed before readme was opened")?;

let directory_watch = owner.dir(PathBuf::from("./src/"))?
    .modify(true)
    .watch()?;

while let Some(event) = directory_watch.next().await
    .wrap_err("anotify closed before any directory events seen")? {
    println!("Got: {event}");
}
Commit count: 36

cargo fmt