On Fri, Jan 29, 2010 at 6:03 AM, jonat...@mugginsoft.com
<jonat...@mugginsoft.com> wrote:
> My app receives both HFS and POSIX NSString file paths back from AppleScript.
>
> On the AS Implementors list I was advised to coerce all the AS data to say 
> HFS before it is converted to an NSString.
>
> This will be my goal but in the short term I will need to detect HFS paths 
> and convert them to POSIX.
>
> What is the best way to *reliably* detect the HFS path type and convert it to 
> POSIX?

I'd assume that you'll always get absolute paths back from your
AppleScript. Relative paths can't be reliably transferred between
processes, and in general are pretty rare on OS X.

If that's the case, then discriminating between them is nice and
simple. Does it start with a slash? If so, it's a POSIX path,
otherwise it's an HFS path.

Mike
_______________________________________________

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