-
Notifications
You must be signed in to change notification settings - Fork 17
Open
panglesd/slipshow
#113Description
Continuing my issue streak :)
In polling mode, the whole directory watched is re-traversed and md5summed every
In inotify mode, the current directory is watched by inotify and only changes in this directory trigger a callback (but a whole scan at the beginning is still done: #41)
Thus, the behaviour is different. Here is an example:
let callback filename =
Format.printf "modification to %s\n%!" filename;
Lwt.return ()
let hook =
if Sys.argv.(1) = "polling" then
Irmin_watcher__.Core.hook (Lazy.force Irmin_watcher__Polling.v)
else Irmin_watcher.hook
let never_ends =
let wait, _ = Lwt.wait () in
wait
let () =
let parent = "./" in
let open Lwt.Syntax in
Lwt_main.run
@@
let* _cancel = hook 0 parent callback in
never_endsNow, call this in polling mode, in a directory , and modify a file in a subdirectory (bin/aaa):
$ ./_build/default/bin/main.exe "polling"
modification to bin/aaa
And the same in inotify mode:
$ ./_build/default/bin/main.exe "inotify"
no modification detected
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels