Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get FSRef for a unicode path



On 08-05-22, at 09:06, Jean-Daniel Dupas wrote:

1. How to get an FSRef for a unicode path?


	FSRef fsrf = {{0}};
	Boolean is_dir = false;
	char *path = "/Volumes/fw";
	err = FSPathMakeRef( (const UInt8 *)path, &fsrf, &is_dir );

Works with an POSIX path, but if Unicode mean UTF-16, you would have to convert it before.


An other way is to use CFURLRef.

CFStringCreateWithCharacters(…)
CFURLCreateWithFileSystemPath(…)
CFURLGetFSRef(…)

Not to mention:

Boolean CFStringGetFileSystemRepresentation( CFStringRef string, char *buffer, CFIndex maxBufLen );


Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@

Sent from my SE/30



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >How to get FSRef for a unicode path (From: Nick Rogers <email@hidden>)
 >Re: How to get FSRef for a unicode path (From: Philip Aker <email@hidden>)
 >Re: How to get FSRef for a unicode path (From: Jean-Daniel Dupas <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.