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

Re: POSIX Path to HFS?


  • Subject: Re: POSIX Path to HFS?
  • From: Rosyna <email@hidden>
  • Date: Thu, 4 Apr 2002 11:18:58 -0700

Might want to change that slightly:

CFRelease(myURL);


into:

if (myURL) CFRelease(myURL):
or
[(NSURL*)myURL release];

if it is null, CFRelease will abort.

Ack, at 4/4/02, Finlay Dobbie said:

On Thursday, April 4, 2002, at 03:20 AM, Rich Long wrote:

I'd like to convert this to HFS format (for example: Macintosh HD:foo:bar.txt), but I can't seem to find a routine that would let me do it.

See CFURL.h

Something like this:
NSString *posixPath; // assume this exists
NSString *hfsPath;
CFURLRef myURL = CFURLCreateWithFileSystemPath(NULL, (CFStringRef)posixPath, kCFURLPOSIXPathStyle, NO);

hfsPath = (NSString *)CFURLCopyFileSystemPath(myURL, kCFURLHFSPathStyle);

NSLog(@"posix path is \"%@\", hfs path is \"%@\"", posixPath, hfsPath);

CFRelease(myURL);
[hfsPath release];

(warning: typed off the top of my head, may or may not work).

--


Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insanely Great People
---

Please include any previous correspondence in replies, it helps me remember what we were talking about. Thanks. _______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >Re: POSIX Path to HFS? (From: Finlay Dobbie <email@hidden>)

  • Prev by Date: Bundle patcher
  • Next by Date: Re: More re: Carbon Events vs Cocoa Events
  • Previous by thread: Re: POSIX Path to HFS?
  • Next by thread: Changing the menu bar
  • Index(es):
    • Date
    • Thread