Skip to content

Instantly share code, notes, and snippets.

@Callisto13
Created October 13, 2019 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Callisto13/4b0b5912585fd2df21d526a40d42fa47 to your computer and use it in GitHub Desktop.
Save Callisto13/4b0b5912585fd2df21d526a40d42fa47 to your computer and use it in GitHub Desktop.
extern crate inotify;
use std::path::PathBuf;
use inotify::{
WatchMask,
Inotify,
};
fn main() {
let mut inotify = Inotify::init().expect("Failed to initialize inotify");
for _i in 0..100 {
let wd = inotify.add_watch(
PathBuf::from("/home/vagrant/target"),
WatchMask::CREATE | WatchMask::DELETE,
).expect("Failed to add inotify watch");
inotify.rm_watch(wd).expect("Failed to remove inotify watch");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment