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?

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to