php > echo IN_ACCESS; //File was accessed (read) (*) 1 php > echo IN_MODIFY; //File was modified (*) 2 php > echo IN_ATTRIB; //Metadata changed (e.g. permissions, mtime, etc.) (*) 4 php > echo IN_CLOSE_WRITE; //File opened for writing was closed (*) 8 php > echo IN_OPEN; //File not opened for writing was closed (*) 32 php > echo IN_MOVED_TO; //File was opened (*) 128 php > echo IN_MOVED_FROM; //File moved into watched directory (*) 64 php > echo IN_CREATE; //File or directory created in watched directory (*) 256 php > echo IN_DELETE; //File or directory deleted in watched directory (*) 512javascript:void(0) php > echo IN_DELETE_SELF; //Watched file or directory was deleted 1024 php > echo IN_MOVE_SELF; //Watch file or directory was moved 2048 php > echo IN_CLOSE; //Equals to IN_CLOSE_WRITE | IN_CLOSE_NOWRITE 24 php > echo IN_MOVE; //Equals to IN_MOVED_FROM | IN_MOVED_TO 192 php > echo IN_ALL_EVENTS; //Bitmask of all the above constants 4095 php > echo IN_UNMOUNT; //File system containing watched object was unmounted 8192 php > echo IN_Q_OVERFLOW; //Watch was removed (explicitly by inotify_rm_watch() or because file was removed or filesystem unmounted 16384 php > echo IN_ISDIR; //Subject of this event is a directory 1073741824 php > echo IN_ONLYDIR; //Only watch pathname if it is a directory (Since Linux 2.6.15) 16777216 php > echo IN_DONT_FOLLOW; //Do not dereference pathname if it is a symlink (Since Linux 2.6.15) 33554432 php > echo IN_MASK_ADD; //Add events to watch mask for this pathname if it already exists (instead of replacing mask). 536870912 php > echo IN_ONESHOT; //Monitor pathname for one event, then remove from watch list. 2147483648
Friday, January 20, 2012
[PHP] PECL Inotify Masks Mapped
The PHP documentation for PECL Inotify is very cryptic when you just want to know the equivalent integer value for each constant. So I mapped the inotify integer masks for myself and everyone else (see below). Might save you save you some time. I will be posting soon a very useful application of inotify which can really power up your PHP-based CLI apps. Cheers!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment