Eio_main.run @@ fun _env ->
let inotify = Eio_inotify.create () in
let _watch = Eio_inotify.add_watch inotify "dir" [Inotify.S_Create] in
let event = Eio_inotify.read inotify in
print_endline (Inotify.string_of_event event)
(* watch=1 cookie=0 events=CREATE "file" *)
Note that Lwt-style & Eio-style interfaces returns events one-by-one, but the Unix-style one returns them in small batches.
Documentation
The API documentation is available at GitHub pages.