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                 s...@rogue-research.com
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

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

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

Reply via email to