根据Apple 文档,在回调中FSEvents
,
/* These flags are only set if you specified the FileEvents */
/* flags when creating the stream. */
kFSEventStreamEventFlagItemCreated = 0x00000100,
kFSEventStreamEventFlagItemRemoved = 0x00000200,
kFSEventStreamEventFlagItemInodeMetaMod = 0x00000400,
kFSEventStreamEventFlagItemRenamed = 0x00000800,
kFSEventStreamEventFlagItemModified = 0x00001000,
kFSEventStreamEventFlagItemFinderInfoMod = 0x00002000,
kFSEventStreamEventFlagItemChangeOwner = 0x00004000,
kFSEventStreamEventFlagItemXattrMod = 0x00008000,
kFSEventStreamEventFlagItemIsFile = 0x00010000,
kFSEventStreamEventFlagItemIsDir = 0x00020000,
kFSEventStreamEventFlagItemIsSymlink = 0x00040000
但是,我三重检查了kFSEventStreamCreateFlagFileEvents
调用时没有设置标志
FSEventStreamRef FSEventStreamCreate(
CFAllocatorRef allocator,
FSEventStreamCallback callback,
FSEventStreamContext *context,
CFArrayRef pathsToWatch,
FSEventStreamEventId sinceWhen,
CFTimeInterval latency,
FSEventStreamCreateFlags flags);
但无论我做什么,当事件从APIkFSEventStreamEventFlagItem*
传递给我时,标志仍在设置中。FSEvents
我怀疑这是一个错误,但我不太确定。我正在使用 OS X Lion 10.7.2
示例代码可以在这里找到。http://stuconnolly.com/downloads/scevents/
编辑
问题是:
有没有其他人经历过同样的结果?
这是我可以用来检查文件事件标志的行为吗?