FSEventStreamCreate and File System Events Wierdness
FSEventStreamCreate and File System Events Wierdness
- Subject: FSEventStreamCreate and File System Events Wierdness
- From: Chris Idou <email@hidden>
- Date: Fri, 29 Jan 2010 04:22:38 -0800 (PST)
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?
OS-X 10.6.2
__________________________________________________________________________________
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