Re: dealing with alias files, finding URL to target file
Re: dealing with alias files, finding URL to target file
- Subject: Re: dealing with alias files, finding URL to target file
- From: Sean McBride <email@hidden>
- Date: Fri, 15 Apr 2011 15:12:35 -0400
- Organization: Rogue Research Inc.
On Fri, 15 Apr 2011 12:01:14 -0700, Quincey Morris said:
>I'll ask the dumb question: what happens if you invoke
>bookmarkDataWithContentsOfURL on a non-alias file? If it correctly
>detects an error, your PITA code could be reduced to:
I thought about that, the docs say:
/* Given the url of a file which is a Finder "alias" file, return a
NSData with the bookmark data from the file. If bookmarkFileURL points
to an alias file created before SnowLeopard which contains Alias Manager
information and no bookmark data, then a NSData will be synthesized
which contains a approximation of the alias information in a format
which can be used to resolve the bookmark. If an error prevents reading
the data or if it is corrupt, NULL will be returned and error will be
filled in if errorRef is non-NULL. */
The first few words suggest I have to check myself, but the "If an error
prevents reading the data" part suggests your suggestion may be safe.
Not sure.
Thanks for the suggestion though!
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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