• 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: Properly comparing file NSURLs for equality?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Properly comparing file NSURLs for equality?


  • Subject: Re: Properly comparing file NSURLs for equality?
  • From: Ken Thomases <email@hidden>
  • Date: Fri, 27 May 2011 21:53:05 -0500

On May 27, 2011, at 7:51 PM, Sean McBride wrote:

> That's perfect!  But for, shall we say, older cats :), would be next best thing be CFURLGetFSRef() & FSCompareFSRefs()?

We just had another thread about this subject.  For pre-10.6, yes, I think that FSCompareFSRefs() is good.  For 10.6, I believe you can convert the URLs to file-reference URLs and then compare with -isEqual:.

I also mentioned that one can use NSFileManager to get the attributes and compare both NSFileDeviceIdentifier and NSFileSystemFileNumber, which is basically equivalent to the earlier suggestion to use lstat() and compare st_dev and st_ino.

Apparently, the NSURLFileResourceIdentifierKey/kCFURLFileResourceIdentifierKey suggestion comes to us from the future. ;)

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: 
 >Properly comparing file NSURLs for equality? (From: Sean McBride <email@hidden>)
 >Re: Properly comparing file NSURLs for equality? (From: Jens Alfke <email@hidden>)
 >Re: Properly comparing file NSURLs for equality? (From: James Walker <email@hidden>)
 >Re: Properly comparing file NSURLs for equality? (From: Douglas Davidson <email@hidden>)
 >Re: Properly comparing file NSURLs for equality? (From: Sean McBride <email@hidden>)

  • Prev by Date: Re: Comprehensible tutorial for Accessorizer?
  • Next by Date: Re: Comprehensible tutorial for Accessorizer?
  • Previous by thread: Re: Properly comparing file NSURLs for equality?
  • Next by thread: Re: Properly comparing file NSURLs for equality?
  • Index(es):
    • Date
    • Thread