Re: Temporary files
Re: Temporary files
- Subject: Re: Temporary files
- From: Jim Correia <email@hidden>
- Date: Tue, 10 Oct 2006 14:15:59 -0400
On Oct 10, 2006, at 2:03 PM, John Stiles wrote:
There are bigger problems with this snippet than a rare race
condition with tempnam:
- This code specifies ASCII encoding, but it's possible that paths
may contain UTF8 characters—and in fact it's likely on non-American
Macs. Remember, folks, path representations are UTF8, not ASCII!
Specifically, Mac OS X currently uses decomposed UTF8 for path
representations. That is an implementation detail you can (and
should) insulate yourself from by using the API provided for
converting between C strings and NS or CF Strings:
CoreFoundation:
CFStringGetFileSystemRepresentation
CFStringCreateWithFileSystemRepresentation
In Foundation there is an NSString category and NSFileManager methods
for doing the conversions.
Jim _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden