• 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: How determine if file is in Trash, given Path or Alias
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How determine if file is in Trash, given Path or Alias


  • Subject: Re: How determine if file is in Trash, given Path or Alias
  • From: Michael Ash <email@hidden>
  • Date: Tue, 2 Jun 2009 00:38:40 -0400

On Mon, Jun 1, 2009 at 6:40 PM, Sean McBride <email@hidden> wrote:
> But it's not a huge issue: fileSystemRepresentation and UTF8String give
> the same thing 99% of the time.

And more importantly, the 1% of the time where they give you different
results, they still give you *equivalent* results.
-fileSystemRepresentation does some canonicalization before converting
to UTF-8, but anything that wants UTF-8 will take the canonical form
and vice versa. (There used to be some bugs on OS X with
non-normalized unicode in the filesystem, but they were fixed a LONG
time ago, so unless you're still writing code for 10.2 or something,
you don't need to worry about this.)

The only reasons to use -fileSystemRepresentation these days are
either to make the code more explicit about its intentions, or to
attempt to proof the code against a change in the file system encoding
to something other than UTF-8. Given the pervasiveness of UTF-8 in Mac
OS X will almost certainly never change until Apple builds something
new from scratch, and quite probably not even then. It may be useful
if you anticipate targeting a non-Apple Cocoa platform such as GNUStep
or Cocotron.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: How determine if file is in Trash, given Path or Alias (From: "Sean McBride" <email@hidden>)
 >Re: How determine if file is in Trash, given Path or Alias (From: Martin Wierschin <email@hidden>)
 >Re: How determine if file is in Trash, given Path or Alias (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: How determine if file is in Trash, given Path or Alias
  • Next by Date: Re: several questions about saving a bundle in an NSDocument based application
  • Previous by thread: Re: How determine if file is in Trash, given Path or Alias
  • Next by thread: Re: How determine if file is in Trash, given Path or Alias
  • Index(es):
    • Date
    • Thread