• 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: Jens Alfke <email@hidden>
  • Date: Fri, 27 May 2011 16:35:58 -0700

On May 27, 2011, at 4:13 PM, Sean McBride wrote:

> What would best practice be?  Convert to full path, and compare those?
> Note: I'm not concerned about resolving symlinks or aliases.

Yeah, I think so. First test -isFileURL, then compare the -path properties.

Comparing paths has its own set of pitfalls: even if you’re not concerned about symlinks, there’s case-insensitivity to deal with. I’m not sure what the best way is to deal with that. You could canonicalize each path; or you could convert each URL to an FSRef and then compare those for equality.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: Properly comparing file NSURLs for equality?
      • From: James Walker <email@hidden>
References: 
 >Properly comparing file NSURLs for equality? (From: Sean McBride <email@hidden>)

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