Re: POSIX Path to HFS?
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.