[−][src]Function inotify_sys::inotify_add_watch
pub unsafe extern "C" fn inotify_add_watch(
fd: c_int,
pathname: *const c_char,
mask: uint32_t
) -> c_int
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:
fd
is the file descriptor of the inotify instance (created byinotify_init
orinotify_init1
)pathname
is the path of the file or directory watchmask
defines the behavior of this function and configures the watch
The following flags in mask
control the type of events to watch for:
IN_ACCESS
IN_ATTRIB
IN_CLOSE_NOWRITE
IN_CLOSE_WRITE
IN_CREATE
IN_DELETE
IN_DELETE_SELF
IN_MODIFY
IN_MOVED_FROM
IN_MOVED_TO
IN_MOVE_SELF
IN_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.