©
本文档使用 PHP中文网手册 发布
下列常量由此扩展定义,且仅在此扩展编译入 PHP 或在运行时动态载入时可用。
IN_ACCESS
( integer )
IN_MODIFY
( integer )
IN_ATTRIB
( integer )
IN_CLOSE_WRITE
( integer )
IN_CLOSE_NOWRITE
( integer )
IN_OPEN
( integer )
IN_MOVED_TO
( integer )
IN_MOVED_FROM
( integer )
IN_CREATE
( integer )
IN_DELETE
( integer )
IN_DELETE_SELF
( integer )
IN_MOVE_SELF
( integer )
IN_CLOSE
( integer )
IN_MOVE
( integer )
IN_ALL_EVENTS
( integer )
IN_UNMOUNT
( integer )
IN_Q_OVERFLOW
( integer )
IN_IGNORED
( integer )
IN_ISDIR
( integer )
IN_ONLYDIR
( integer )
IN_DONT_FOLLOW
( integer )
IN_MASK_ADD
( integer )
IN_ONESHOT
( integer )
Note: The events marked with an asterisk (*) above can occur for files in watched directories.
[#1] rogere84 at gmail dot com [2014-04-16 06:52:37]
I noticed that the values of the constants seem to be missing. Granted, these could change dependant on version but on my system here are the values (should you want them).
IN_ACCESS = 1
IN_MODIFY = 2
IN_ATTRIB = 4
IN_CLOSE_WRITE = 8
IN_CLOSE_NOWRITE = 16
IN_OPEN = 32
IN_MOVED_FROM = 64
IN_MOVED_TO = 128
IN_CREATE = 256
IN_DELETE = 512
IN_DELETE_SELF = 1024
IN_MOVE_SELF = 2048
IN_UNMOUNT = 8192
IN_Q_OVERFLOW = 16384
IN_IGNORED = 32768
IN_CLOSE = 24
IN_MOVE = 192
IN_ALL_EVENTS = 4095
IN_ONLYDIR = 16777216
IN_DONT_FOLLOW = 33554432
IN_MASK_ADD = 536870912
IN_ISDIR = 1073741824
IN_ONESHOT = 2147483648
[#2] crownedgrouse [2009-03-13 02:11:19]
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 .