Re: POSIX Path to HFS?
Re: POSIX Path to HFS?
- Subject: Re: POSIX Path to HFS?
- From: Finlay Dobbie <email@hidden>
- Date: Thu, 4 Apr 2002 13:22:14 +0100
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).
-- Finlay
_______________________________________________
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.