Created
October 13, 2019 12:59
-
-
Save Callisto13/4b0b5912585fd2df21d526a40d42fa47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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