{ } qjs-modules

inotify

Source: lib/inotify.js (pure JS) — default export: inotify

Linux inotify filesystem-watch bindings plus a class wrapper.

Exports

ExportArgsKindDescription
inotify_init(flags=0)0–1functionCreates an inotify instance; returns its fd.
inotify_add_watch(fd, pathname, mask=IN_ALL_EVENTS)2–3functionAdds/updates a watch; returns a watch descriptor.
inotify_rm_watch(fd, wd)2functionRemoves a watch.
inotify_close(fd)1functionCloses an inotify fd.
inotify—classObject-oriented wrapper around the above. (default export)

Also re-exports the IN_* event-mask constants (e.g. IN_CREATE, IN_MODIFY, IN_DELETE, IN_ALL_EVENTS).