Re: How do I get a file reference w/o relying on the path?
Re: How do I get a file reference w/o relying on the path?
- Subject: Re: How do I get a file reference w/o relying on the path?
- From: Ken Thomases <email@hidden>
- Date: Sun, 4 Apr 2010 13:25:23 -0500
On Apr 4, 2010, at 12:50 PM, Jens Alfke wrote:
> You're saying that if I have a FSRef to a file, then the file is moved, the FSRef will still reference the moved file and not the location where it used to be?
Yes. They are file-ID-based.
> That's surprising to me, because FSRefs were created as a replacement for FSSpecs, which do not have that property (they were a struct {volume ID, dir ID, filename}.)
True, although FSSpecs should have tracked the parent directory should it have been moved or renamed. I'm not sure they did, though.
Also, remember that, unlike FSSpecs, FSRefs can only refer to existing files/directories -- precisely because they are file-ID-based.
It's hardly surprising that the replacement differs from the original, otherwise why replace the original?
Cheers,
Ken
_______________________________________________
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