Re: FSEventStreamCreate and File System Events Wierdness
Re: FSEventStreamCreate and File System Events Wierdness
- Subject: Re: FSEventStreamCreate and File System Events Wierdness
- From: Chris Idou <email@hidden>
- Date: Fri, 29 Jan 2010 04:36:36 -0800 (PST)
Firstly, I don't think that actually makes sense, given the whole point of the lastEventId.
Secondly, it only does it for the first folder you pass in, so it isn't even consistent.
But yes I guess one could compare and ignore.
________________________________
From: Graham Cox <email@hidden>
To: Chris Idou <email@hidden>
Cc: email@hidden
Sent: Fri, 29 January, 2010 11:27:31 PM
Subject: Re: FSEventStreamCreate and File System Events Wierdness
Well, I have no experience of this API, but perhaps it's designed to do this so that when you restart a stream, you get an event that gives you a snapshot or starting point for the new session.
Seems to me it would be trivial to compare the event ID and if it's the one you just passed in, ignore it.
--Graham
On 29/01/2010, at 11:22 PM, Chris Idou wrote:
> I'm trying to use the file system events api, but what I'm seeing seems wierd.
>
> Firstly, the documentation as I read it says you can store the last event id, and pass that to FSEventStreamCreate next time to carry on where you left off. However what I'm seeing if I do that, is it immediately resends me that event. So lets say I process event 877921818. I store that and exit the program. Next time I pass 877921818 to FSEventStreamCreate and I immediately get another callback with event id 877921818, so I end up processing it again.
>
> So I'm thinking to myself, maybe what it really wants is the lastevent+1. So I pass 877921819 to FSEventStreamCreate instead. But then what happens is I immediately get a callback with event 877921819. This despite that nothing has changed. (I'm actually monitoring an empty folder, and nothing is changing, not even so much as timestamps or anything). If I pass lastEvent+10 I immediately get a callback with that id, even though nothing has changed.
>
> Interestingly, if I monitor multiple folders, it seems to only callback with whichever one is passed in first.
>
> It seems like if you pass an explicit event id into FSEventStreamCreate in absolutely insists on giving you an immediate callback that something changed with whichever is the first folder in the list, even though in fact nothing has changed. It seems to be broken in a major way, but its hard to believe something like is is *that* broken.
>
> Any comments?
__________________________________________________________________________________
Yahoo!7: Catch-up on your favourite Channel 7 TV shows easily, legally, and for free at PLUS7. www.tv.yahoo.com.au/plus7
_______________________________________________
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