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?

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}.)

Anyway, note that a file inode ID is more fragile than an alias/bookmark, 
because it won't survive the common practice of replacing an old copy of a file 
with a new one ("safe save") unless the code doing the replace is careful to 
propagate metadata to the new file. 

--Jens {via iPad}

On Apr 4, 2010, at 8:00 AM, Ken Thomases <k...@codeweavers.com> wrote:

> On Apr 3, 2010, at 8:31 PM, Jens Alfke wrote:
> 
>> Ken, he asked for a reference that wouldn't break if the file were moved or 
>> renamed. Neither FSrefs nor URLs have that property.
> 
> Yes, they do.
> 
> From the link I gave 
> <http://developer.apple.com/mac/library/documentation/cocoa/conceptual/LowLevelFileMgmt/Articles/FileManagementNSURL.html>:
> 
> "File reference URLs provide a way to track a file by its ID. This means that 
> the reference is valid even if the file’s name or location in the file system 
> changes."
> 
> File reference URLs are new with Snow Leopard.  Check out the release notes 
> and "What's New in Mac OS X: Mac OS X 10.6" to learn about them.
> 
> And FSRefs have always had this property.  Adding file reference URLs was 
> essentially a way of allowing URLs to provide analogous functionality as 
> FSRefs.
> 
> Regards,
> Ken
> 
_______________________________________________

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