> On Jan 6, 2015, at 7:40 PM, Kyle Sluder <k...@ksluder.com> wrote:
> 
>> On Jan 6, 2015, at 5:05 PM, Trygve Inda <cocoa...@xericdesign.com> 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.

Ultimately what I need to able to do is compare a bookmark to a path. I
would like to do this using NSArray's indexOfObject with a path derived from
the bookmark, but because the bookmark's path is not updated when only the
case changes, this sort of comparison will not work.

Basically I would like a method like:

[bookmarkData isEqualToPath:path]





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to