Re: FSEvent- FSEventStreamEventFlags
Re: FSEvent- FSEventStreamEventFlags
- Subject: Re: FSEvent- FSEventStreamEventFlags
- From: Jens Alfke <email@hidden>
- Date: Thu, 12 Jun 2008 07:40:44 -0700
On 12 Jun '08, at 5:57 AM, santoshb wrote:
I want to know how we can get the file close event using
FSEventStreamEventFlags.
I have written the code for get the event when user write, open and
close the file. But we are not able to distinguish between which
event is for which purpose.
You can't. The FSEvents API only tells you what _directories_ have
been changed, and only sometime after the changes happen. It doesn't
tell you about individual changes, or even what files changed, much
less individual open/write/close calls. (The reason is that doing so
doesn't scale — the system would choke under the burden of delivering
so many notifications.)
Did you read the "File System Events Programming Guide"? Its overview
section says:
When your application registers for notification, the file system
events daemon will post a notification every time that any file in
the monitored directory hierarchy changes. It will also post a
notification if the directory itself is modified (for example, if
its permissions change or a new file is added). The important point
to take away is that the granularity of notifications is at a
directory level. It tells you only that something in the directory
has changed, but does not tell you what changed.
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden