Bindings for inotify
There are four types of statics:
- Flags, to be passed to
inotify_init1()
; - Events, that describe which events should be
watched for (when calling
inotify_add_watch()
), and which event has occured (when returned byread()
); - Options, which can be added to the bit mask
passed to
inotify_add_watch()
, to change default behavior; - Infos, indicating further details of the event
that occured (returned by
read()
).
When events occur for monitored files and directories, those events
are made available to the application as structured data that can
be read from the inotify file descriptor using read()
.
When all file descriptors referring to an inotify instance have been
closed (using close()
), the underlying object and its resources
are freed for reuse by the kernel; all associated watches are
automatically freed.
A programmer wanting to use inotify should also carefully read through the inotify(7) man page, which contains many caveats, warnings, and recommendations for proper, robust, and efficient usage of inotify.