PHP - Inotify add_watch() Function

inotify_add_watch() function can add a watch to an initialized inotify instance.


int inotify_add_watch( resource $inotify_instance , string $pathname , int $mask )

inotify_add_watch() function can add a new watch or modify an existing watch for a file or directory specified in the pathname. By using the inotify_add_watch() function on a watched object can replace an existing watch. By using the IN_MASK_ADD constant can add (OR) events to an existing watch.

inotify_add_watch() return value is unique (inotify instance wide) watch descriptor.

Kickstart Your Career

Get certified by completing the course

Get Started