📁 Naughtyfy
A modern fanotify wrapper.
Note: This is still under development.
Feel free to open issues on the repo.
Example
use naughtyfy::api::*;
use naughtyfy::flags::*;
fn main() {
unsafe {
FAN_EVENT_BUFFER_LEN = 230.into();
}
let fd = &init(FAN_CLASS_NOTIF, 0).unwrap();
mark(fd, FAN_MARK_ADD | FAN_MARK_MOUNT, FAN_ACCESS, AT_FDCWD, "/").unwrap();
let mut iter = 1;
loop {
let res = read(fd).unwrap();
println!("{res:#?}");
res.iter().for_each(|e| close(e.fd).unwrap());
iter += 1;
if iter > 100 {
break;
}
}
}
Docs
Goals
- Safe
- Less overhead
- Documented
- Desciptive errors
Even though it's not designed to be blazzingly fast but is comparable. Will get better with further updates.
Thanks