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