• 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: HFS Path To POSIX Path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HFS Path To POSIX Path


  • Subject: Re: HFS Path To POSIX Path
  • From: "James W. Walker" <email@hidden>
  • Date: Mon, 1 Sep 2008 17:35:58 -0700


On Sep 1, 2008, at 5:27 PM, J. Todd Slack wrote:

What is the proper way to convert an HFS Path to a POSIX path?

So take: Husband:Users:slack:Music:iTunes:iTunes Music:Adult:Resucitation:03 - Minors at night.mp3

and convert to: /Users/slack/Music/iTunes:/Tunes Music/Adult/ Resucitation/03 - Minors at night.mp3

I thought there was an NSFileManager Command.


I don't know of a completely Cocoa approach, but you could use CFURLCreateWithFileSystemPath to convert the HFS path to a CFURLRef, and then typecast the CFURLRef as NSURL*. A possible gotcha is that I don't know what character encoding would be used in an HFS path.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: 
 >HFS Path To POSIX Path (From: "J. Todd Slack" <email@hidden>)

  • Prev by Date: Re: NSArray as a static
  • Next by Date: Re: NSTableView/NSOutlineView variable row height
  • Previous by thread: HFS Path To POSIX Path
  • Next by thread: Re: HFS Path To POSIX Path
  • Index(es):
    • Date
    • Thread