watch/backend
platform-specific OS watcher bridge (internal).
backend-supported?
(backend-supported?)
1 if the current build target has a real
backend-open
(backend-open [dir : cstr base : cstr])
register a directory + basename for watching.
| dir | directory to observe (non-empty) | |
| base | basename of the target file inside dir (may be "" to | |
| forward every event from dir to the caller) |
backend-close
(backend-close [handle : int])
release backend handle. Safe on 0.
backend-wait
(backend-wait [handle : int timeout-ms : int])
block until the backend reports activity or timeout.
| handle | watcher handle from backend-open | |
| timeout-ms | -1 = forever, 0 = poll, N = bounded wait |
1 the OS queue has events ready (call backend-drain next) 0 the timeout expired with no events -1 a fatal backend error occurred
backend-drain-into
(backend-drain-into [handle : int])
drain all queued OS events into the handle's evbuf.
N >= 0 number of events stored in evbuf (ev_n) -1 fatal read error Overflow is stored on the handle; query via backend-last-overflow?. Calling this function clears ev_n and overflow before draining.
backend-drain
(backend-drain [handle : int])
drain events and return a boolean result.
backend-event-count
(backend-event-count [handle : int])
number of events stored in evbuf after a drain.
backend-event-name-at
(backend-event-name-at [handle : int idx : int])
filename from the i-th buffered event.
backend-event-mask-at
(backend-event-mask-at [handle : int idx : int])
OS event flags from the i-th buffered event.
backend-event-cookie-at
(backend-event-cookie-at [handle : int idx : int])
inotify rename cookie from the i-th event.
backend-event-is-dir-at
(backend-event-is-dir-at [handle : int idx : int])
1 if the i-th event's target is a directory.
backend-last-overflow?
(backend-last-overflow? [handle : int])
1 if the most recent drain saw an overflow.
backend-dir
(backend-dir [handle : int])
registered directory (read-only borrow).
backend-base
(backend-base [handle : int])
registered basename (read-only borrow; "" for dir-only).
backend-fd
(backend-fd [handle : int])
the OS file descriptor underlying the backend, suitable