Skip to main content

Module inotify

Module inotify 

Source
Expand description

Raw inotify helpers.

This module provides low-level interaction with the Linux inotify subsystem. It handles the initialization of watches, reading of raw events, and decoding of the packed event stream.

Higher-level modules should use these primitives to monitor configuration files, log directories, or process markers. The API stays close to kernel behavior and does only minimal decoding.

Structs§

InotifyEvent
A decoded inotify event header.

Constants§

DELETE_SELF_MASK
Watched file/directory was deleted (IN_DELETE_SELF).
IGNORED_MASK
Watch was removed (IN_IGNORED).
MODIFY_MASK
File was modified (IN_MODIFY).
MOVE_SELF_MASK
Watched file/directory was moved (IN_MOVE_SELF).
PACKAGE_FILE_MASK
Mask for monitoring package file state changes (IN_MODIFY | IN_DELETE_SELF | IN_MOVE_SELF).
PARENT_WATCH_MASK
Mask for monitoring parent directories that may create, replace, or remove a watched file. Maps to IN_CREATE | IN_MOVED_TO | IN_CLOSE_WRITE | IN_MODIFY | IN_DELETE_SELF | IN_MOVE_SELF.
QUEUE_OVERFLOW_MASK
Inotify event queue overflowed (IN_Q_OVERFLOW).
UNMOUNT_MASK
Filesystem containing watched object was unmounted (IN_UNMOUNT).

Functions§

add_watch
Add a watch to an existing inotify instance.
decode_events
Decode packed inotify events from a raw byte buffer.
init
Create a non-blocking close-on-exec inotify file descriptor.
read_events
Read all available inotify events from the descriptor.
remove_watch
Remove an existing watch descriptor from an inotify instance.