smooooth/lib/watch.ml
2025-05-25 01:43:14 +10:00

16 lines
317 B
OCaml

open Lwt.Syntax
let watch_changes path =
let* notify = Lwt_inotify.create () in
let* _watch =
Lwt_inotify.add_watch notify path
[
Inotify.S_Create;
Inotify.S_Close_write;
Inotify.S_Modify;
Inotify.S_Move;
Inotify.S_Delete;
]
in
Lwt_inotify.read notify