Be carefull using IN_MODIFY :
Lot of UNIX editor, for instance like 'vi', work in a 'xxx~' file, and changes are written in 'xxx' when saving or saving and closing.
If a watcher is done on 'xxx', no IN_MODIFY event occurs while not saved !
Prefere IN_CLOSE_WRITE in such case .
As contantes abaixo são definidas por esta extensão e somente estarão disponíveis quando a extensão foi compilada com o PHP ou carregada dinamicamente durante a execução.
Inotify constants usable with inotify_add_watch() and/or returned by inotify_read()
- File was accessed (read) (*)
- File was modified (*)
- Metadata changed (e.g. permissions, mtime, etc.) (*)
- File opened for writing was closed (*)
- File not opened for writing was closed (*)
- File was opened (*)
- File moved into watched directory (*)
- File moved out of watched directory (*)
- File or directory created in watched directory (*)
- File or directory deleted in watched directory (*)
- Watched file or directory was deleted
- Watch file or directory was moved
- Equals to IN_CLOSE_WRITE | IN_CLOSE_NOWRITE
- Equals to IN_MOVED_FROM | IN_MOVED_TO
- Bitmask of all the above constants
- File system containing watched object was unmounted
- Event queue overflowed (wd is -1 for this event)
- Watch was removed (explicitly by inotify_rm_watch() or because file was removed or filesystem unmounted
- Subject of this event is a directory
- Only watch pathname if it is a directory (Since Linux 2.6.15)
- Do not dereference pathname if it is a symlink (Since Linux 2.6.15)
- Add events to watch mask for this pathname if it already exists (instead of replacing mask).
- Monitor pathname for one event, then remove from watch list.
Nota: The events marked with an asterisk (*) above can occur for files in watched directories.