Re: Detect HFS path type and coerce to POSIX
Re: Detect HFS path type and coerce to POSIX
- Subject: Re: Detect HFS path type and coerce to POSIX
- From: Michael Ash <email@hidden>
- Date: Fri, 29 Jan 2010 12:30:07 -0500
On Fri, Jan 29, 2010 at 6:03 AM, email@hidden
<email@hidden> 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 (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