• 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: "Sean McBride" <email@hidden>
  • Date: Mon, 1 Jun 2009 18:40:15 -0400
  • Organization: Rogue Research Inc.

On 6/1/09 3:03 PM, Martin Wierschin said:

>>> const UInt8* utfPath = (UInt8*)[path UTF8String];
>>> OSStatus err = DetermineIfPathIsEnclosedByFolder
>>> (kOnAppropriateDisk, kTrashFolderType, utfPath, false, &inTrash);
>>
>> For the archives: 2 more problems:
>>
>> a) use fileSystemRepresentation not UTF8String.
>
>I initially considered that, but the documentation for
>DetermineIfPathIsEnclosedByFolder specifically says it requires UTF-8
>encoded characters, while fileSystemRepresentation mentions no
>guarantee as to the encoding.

Nice catch.

>I'm sure that that the file system
>representation is currently UTF-8, and will stay that way, but I
>don't want to make that assumption.
>
>I don't often work with the C-based APIs, so maybe I'm way off base
>here. Should I file a documentation bug? And if so, which piece of
>documentation needs adjusting?

I'd say it's DetermineIfPathIsEnclosedByFolder's docs that could use
clarifying.  But at least they say _something_ about encoding, unlike
the man pages for open() and friends. :)

But it's not a huge issue: fileSystemRepresentation and UTF8String give
the same thing 99% of the time.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

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

  • Follow-Ups:
    • Re: How determine if file is in Trash, given Path or Alias
      • From: Michael Ash <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>)

  • Prev by Date: Re: SQL store, GC apps, "statement is still active" exception, setReturnsObjectsAsFaults:NO
  • Next by Date: Re: NSXMLParser - howto resolve entities defined in DTD
  • 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