pub unsafe extern "C" fn inotify_add_watch(
fd: c_int,
pathname: *const c_char,
mask: u32,
) -> c_intExpand description
Adds or updates an inotify watch
Adds an item to the watch list of an inotify instance, or modifies an item on that list. This function takes the following arguments:
fdis the file descriptor of the inotify instance (created byinotify_initorinotify_init1)pathnameis the path of the file or directory watchmaskdefines the behavior of this function and configures the watch
The following flags in mask control the type of events to watch for:
IN_ACCESSIN_ATTRIBIN_CLOSE_NOWRITEIN_CLOSE_WRITEIN_CREATEIN_DELETEIN_DELETE_SELFIN_MODIFYIN_MOVED_FROMIN_MOVED_TOIN_MOVE_SELFIN_OPEN
The following constants can be used as shortcuts to set multiple event flags:
In addition, the following flags can be set to control the behaviors of the watch and this function:
The function returns -1 if an error occured. Otherwise, it returns a
watch descriptor that can be used to remove the watch using
inotify_rm_watch or identify the watch via inotify_event’s [wd`]
field.
Please refer to the man page for additional details.