Re: FSEvents bug?
Re: FSEvents bug?
- Subject: Re: FSEvents bug?
- From: Steve Gehrman <email@hidden>
- Date: Tue, 22 Sep 2009 13:48:47 -0700
Thanks for the tip. I already have a few hacks like this to get
around other similar issues.
Why doesn't Apple fix it so it's consistent?
I've never gotten FSEvents working 100%, I still get reports from
users saying it's stops working mysteriously for some folders. Have
you ever seen this?
-steve
On Sep 22, 2009, at 8:32 AM, James Bucanek wrote:
Steve Gehrman <mailto:email@hidden> wrote (Tuesday, September
22, 2009 3:57 AM -0700):
I see at the very least an inconsistency in FSEvents. I'm watching
the root of a device on the boot disk, the relative path is "".
I'm using FSEventStreamCreateRelativeToDevice
If I'm at "/" and type "touch test"
I get an FSEvent with the path "", that works fine.
But when I do an "rm test"
I get an FSEvent with the path "/". My code is watching for path
"" so it fails.
Is this the expected behavior or a bug?
I don't know if it's a bug or not, but some FSEvent paths seem to be
path fragments while others are full POSIX paths, that may or may
not have a trailing '/'.
In my code, I ended up "normalizing" all directory paths (watch and
event) so that they all have a trailing space:
if (![path endsWithString:@"/"])
path = [path stringByAppendingString:@"/"];
I haven't had any problems.
James
--
James Bucanek
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden