package inotify
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Inotify bindings for OCaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
inotify-2.5.tbz
sha256=829aec332ccb46f61876b23c38059afcf7802516d3697c1aa15e1916be72114b
sha512=3dea21ae119cb9c524e9b4a2d3b324d8d46df41bda57c32b11563802646ac2be37b76f629f0c5fd8fc3635684feea8f1abaf7d4efd8b2b5c3618a5d935aa94b1
doc/src/inotify.lwt/lwt_inotify.ml.html
Source file lwt_inotify.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59open Lwt type t = { queue : Inotify.event Queue.t; unix_fd : Unix.file_descr; lwt_fd : Lwt_unix.file_descr; } let create' () = let unix_fd = Inotify.create () in { queue = Queue.create (); lwt_fd = Lwt_unix.of_unix_file_descr unix_fd; unix_fd; } let create () = try return (create' ()) with exn -> Lwt.fail exn let add_watch' inotify path selector = Inotify.add_watch inotify.unix_fd path selector let add_watch inotify path selector = try return (add_watch' inotify path selector) with exn -> Lwt.fail exn let rm_watch' inotify wd = Inotify.rm_watch inotify.unix_fd wd let rm_watch inotify wd = try return (rm_watch' inotify wd) with exn -> Lwt.fail exn let rec read inotify = try return (Queue.take inotify.queue) with Queue.Empty -> Lwt_unix.wait_read inotify.lwt_fd >>= fun () -> begin try let events = Inotify.read inotify.unix_fd in List.iter (fun event -> Queue.push event inotify.queue) events; return_unit with exn -> Lwt.fail exn end >>= fun () -> read inotify let rec try_read inotify = try return (Some (Queue.take inotify.queue)) with Queue.Empty -> if Lwt_unix.readable inotify.lwt_fd then read inotify >|= fun x -> Some x else return_none let close inotify = Lwt_unix.close inotify.lwt_fd
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>