Racket bindings for the Linux inotify API
(require inotify) | package: inotify |
Racket bindings for the Linux inotify file system event monitor API. A useful alternative to Racket’s native file system change events API that offers finer control over what events to be alerted about.
Currently only supported for 64-bit Racket.
It’s basically the same workflow as the native C API: First create an inotify descriptor/instance with open-inotify-instance, add files to monitor for given events with inotify-set-watch, and read inotify-events with read-inotify-event. inotify-instance objects are also sync-able; their synchronization result is an inotify-event.
procedure
(inotify-instance? obj) → boolean?
obj : any/c
procedure
Wrapper around the C inotify_init(2) syscall.
procedure
(close-inotify-instance in) → void?
in : inotify-instance?
procedure
(inotify-watch? obj) → boolean?
obj : any/c
procedure
(inotify-set-watch in file events) → inotify-watch?
in : inotify-instance? file : path-string? events : (listof symbol?)
Wrapper around the C inotify_add_watch(2) syscall.
procedure
(inotify-set-watch* in watches) → (listof inotify-watch?)
in : inotify-instance? watches : (listof (list/c path-string? (listof symbol?)))
procedure
(inotify-remove-watch in wd) → void?
in : inotify-instance? wd : inotify-watch?
Wrapper around the C inotify_rm_watch(2) syscall.
procedure
(call-with-inotify-instance proc) → any
proc : (-> inotify-instance? any) (call-with-inotify-instance watches proc) → any watches : (listof (list/c path-string? (listof symbol?))) proc : (-> inotify-instance? (listof inotify-watch?) any)
struct
(struct inotify-event (wd flags cookie name) #:transparent) wd : inotify-watch? flags : (listof symbol?) cookie : exact-nonnegative-integer? name : (or/c path? #f)
procedure
(read-inotify-event in) → inotify-event?
in : inotify-instance?
procedure
(read-inotify-event* in) → (or/c inotify-event? #f)
in : inotify-instance?
procedure
procedure
procedure