• 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: Normalizing a path containing a symlink
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Normalizing a path containing a symlink


  • Subject: Re: Normalizing a path containing a symlink
  • From: Charles Srstka <email@hidden>
  • Date: Sat, 16 Nov 2013 12:52:41 -0600

On Nov 16, 2013, at 12:24 PM, Mike Abdullah <email@hidden> wrote:

> How about using -fileReferenceURL on everything? That won't give you a normalized *path* as such, but should give you consistent URLs for identifying individual files
>
> Mike.

You could also use getResourceValue:forKey:error: on the URLs with NSURLFileResourceIdentifierKey as the key, and compare the resulting objects.

The one caveat of this is that the file resource identifiers will be equal if the files have the same inode, so comparing two hard links of the same file (for example, /bin/rm and /bin/unlink) will turn up the result that the files are equal, despite having different paths. If that isn't an issue, though, then this is a pretty consistent way to compare files.

Charles


_______________________________________________

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: 
 >Re: Normalizing a path containing a symlink (From: Mike Abdullah <email@hidden>)

  • Prev by Date: Re: Normalizing a path containing a symlink
  • Next by Date: Re: No Accessibility for Many Status Items
  • Previous by thread: Re: Normalizing a path containing a symlink
  • Next by thread: Re: Normalizing a path containing a symlink
  • Index(es):
    • Date
    • Thread