• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do I get a file reference w/o relying on the path?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >How do I get a file reference w/o relying on the path? (From: Brad Stone <email@hidden>)
 >Re: How do I get a file reference w/o relying on the path? (From: Ken Thomases <email@hidden>)
 >Re: How do I get a file reference w/o relying on the path? (From: Jens Alfke <email@hidden>)
 >Re: How do I get a file reference w/o relying on the path? (From: Ken Thomases <email@hidden>)
 >Re: How do I get a file reference w/o relying on the path? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: How do I get a file reference w/o relying on the path?
  • Next by Date: Re: Terminating subtasks reliably
  • Previous by thread: Re: How do I get a file reference w/o relying on the path?
  • Next by thread: Re: How do I get a file reference w/o relying on the path?
  • Index(es):
    • Date
    • Thread