• 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: Temporary files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Temporary files (From: Martin Hairer <email@hidden>)
 >Re: Temporary files (From: Ryan Britton <email@hidden>)
 >Re: Temporary files (From: Nir Soffer <email@hidden>)
 >Re: Temporary files (From: John Stiles <email@hidden>)

  • Prev by Date: Fwd: Setting NSTextView <--Field
  • Next by Date: Re: Code injection and replace methods at runtime
  • Previous by thread: Re: Temporary files
  • Next by thread: Re: Temporary files
  • Index(es):
    • Date
    • Thread