• 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: URLByResolvingBookmarkData not case sensitive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: URLByResolvingBookmarkData not case sensitive


  • Subject: Re: URLByResolvingBookmarkData not case sensitive
  • From: Ken Thomases <email@hidden>
  • Date: Tue, 06 Jan 2015 20:20:56 -0600

On Jan 6, 2015, at 7:40 PM, Kyle Sluder <email@hidden> wrote:

> On Jan 6, 2015, at 5:05 PM, Trygve Inda <email@hidden> wrote:
>
>> If I bookmark a file and the case of any folders or the file itself changes,
>> then later when I extract the path from the bookmark I want it to reflect
>> the new case of the path as it now exists.
>
> Use -[NSFileManager componentsToDisplayForPath:]. Then you don’t even need to canonicalize anything yourself.

Yes.  Also, the components to display for a path are *not* the display name for each path component.  For example, the user never sees /Volumes.

You should try to avoid displaying file paths to the user if at all possible.  If you must, try using an NSPathControl.  That does additional simplification of the path, like starting paths inside the user's home at the home folder and not showing the parent directories of the home folder (e.g. /Users).

If you really, really need to canonicalize a URL, you can try converting it to a file reference URL using -fileReferenceURL and then back to a file path URL using -filePathURL.  See the documentation for -fileReferenceURL for caveats.  Also, this conversion can produce unexpected results in the face of symlinks and/or hard links.

Regards,
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


  • Follow-Ups:
    • Re: URLByResolvingBookmarkData not case sensitive
      • From: Trygve Inda <email@hidden>
References: 
 >Re: URLByResolvingBookmarkData not case sensitive (From: Trygve Inda <email@hidden>)
 >Re: URLByResolvingBookmarkData not case sensitive (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: URLByResolvingBookmarkData not case sensitive
  • Next by Date: Re: URLByResolvingBookmarkData not case sensitive
  • Previous by thread: Re: URLByResolvingBookmarkData not case sensitive
  • Next by thread: Re: URLByResolvingBookmarkData not case sensitive
  • Index(es):
    • Date
    • Thread