Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

55
vendor/inotify/examples/watch.rs vendored Normal file
View File

@@ -0,0 +1,55 @@
use std::env;
use inotify::{
EventMask,
Inotify,
WatchMask,
};
fn main() {
let mut inotify = Inotify::init()
.expect("Failed to initialize inotify");
let current_dir = env::current_dir()
.expect("Failed to determine current directory");
inotify
.watches()
.add(
current_dir,
WatchMask::MODIFY | WatchMask::CREATE | WatchMask::DELETE,
)
.expect("Failed to add inotify watch");
println!("Watching current directory for activity...");
let mut buffer = [0u8; 4096];
loop {
let events = inotify
.read_events_blocking(&mut buffer)
.expect("Failed to read inotify events");
for event in events {
if event.mask.contains(EventMask::CREATE) {
if event.mask.contains(EventMask::ISDIR) {
println!("Directory created: {:?}", event.name);
} else {
println!("File created: {:?}", event.name);
}
} else if event.mask.contains(EventMask::DELETE) {
if event.mask.contains(EventMask::ISDIR) {
println!("Directory deleted: {:?}", event.name);
} else {
println!("File deleted: {:?}", event.name);
}
} else if event.mask.contains(EventMask::MODIFY) {
if event.mask.contains(EventMask::ISDIR) {
println!("Directory modified: {:?}", event.name);
} else {
println!("File modified: {:?}", event.name);
}
}
}
}
}