Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: kqueue and resource forks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kqueue and resource forks



One of the engineers here was interested enough in your post earlier to write a test program that looks for events on any file named on the command line. When he ran the program on 10.5, and specified the file name, he got notifications for both file and resource fork modifications. Of course, they were mixed together, and it was impossible to tell which were happening to the file and which were happening to the resource.

On 10.6, the same program with the file name specified produced only events for the file. However, if he specified "the file/rsrc", it reported only events for the resource fork and not from the file. So it was possible to differentiate between events on the file and events on the resource, without the values being mixed together for the program receiving the events to (hopefully) separate out.

You could go on to consider a file with 250 extended attributes; if you did the 10.5 thing, you'd get an event, then have to check 250 things to see which of those things the event was being reported on; if you did the 10.6 thing, you'd get distinguishable events for the thing on which the event happened.

I think this is "as designed", and the resource modification events in 10.5 were a side effect, but we were unable to attribute the change to a particular product requirement (which doesn't necessarily mean anything); you're of course welcome to file a bug on it.

-- Terry

On Sep 10, 2009, at 10:42 PM, Steve Gehrman wrote:
I just reinstalled 10.5 and XCode and tested it. It definitely worked on 10.5 and now does not work on 10.6

The Finder seems to update, so it must be detecting the change somehow, but I can't get it working on 10.6 using the same code that worked on 10.5

Could you test this over there to see? If you set the file's Open With settings in the finder it will add a resource fork. Set up a test app to watch that file with kqueues and it shouldn't fire on 10.6. I used both my code and Google toolbox's kqueue code. Both were the same.

-steve

On Sep 10, 2009, at 8:11 PM, Terry Lambert wrote:

On Sep 10, 2009, at 4:30 PM, Steve Gehrman wrote:
I'm pretty sure this worked in 10.5. One 10.6 i set kqueues to watch a file. If I modify the resource fork or add or delete the fork, the kqueue event doesn't fire and I don't get notified to update.

This is on a normal HFS+ volume, so it's not doing the ._ file

Anyone know if this was a change in 10.6? I don't remember getting bug reports for my 10.5 builds.


You have it backwards.

I'm pretty sure this did not work in 10.5, except on UFS, and that doesn't natively support resource forks.

In 10.6, we actually added support for a lot of FS-level kevents at the VNOP_ KPI layer, which means that they'll apply to all filesystems equally, but probably still not resource forks individually (part of the removal of UFS support was to support these events for programs that needed them on non-UFS FS types.

If you are getting errors now, it's probably because you asked for events before that it was impossible for you to get except on UFS in 10.5, and now you are getting them for HFS+, and aren't reacting correctly to them occurring. Generally, if something doesn't work, you shouldn't be asking for it in old software, in case it starts working in new software. I expect if you were to try this on 10.5 on UFS, you'd see the same sort of things.


-- Terry


_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >kqueue and resource forks (From: Steve Gehrman <email@hidden>)
 >Re: kqueue and resource forks (From: Terry Lambert <email@hidden>)
 >Re: kqueue and resource forks (From: Steve Gehrman <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.