• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Detect HFS path type and coerce to POSIX
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Detect HFS path type and coerce to POSIX (From: "email@hidden" <email@hidden>)

  • Prev by Date: Re: NSXML and invalid UTF8 characters
  • Next by Date: Re: should I use CALayer .. ?
  • Previous by thread: Detect HFS path type and coerce to POSIX
  • Next by thread: should I use CALayer .. ?
  • Index(es):
    • Date
    • Thread