• 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: Setting the bundle bit [Was: Re: UTI's and document packages]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting the bundle bit [Was: Re: UTI's and document packages]


  • Subject: Re: Setting the bundle bit [Was: Re: UTI's and document packages]
  • From: Antonio Nunes <email@hidden>
  • Date: Tue, 27 Nov 2007 19:43:59 +0000

On 27 Nov 2007, at 10:58, Alastair Houghton wrote:

-UTF8String and -cString are *never* right for paths. You should be using
-fileSystemRepresentation.

Thanks, I adjusted that.


2. The path could of course be either a folder or a file, but it shouldn't matter whether the code coerces it to FileInfo or FolderInfo in this case.

Since you're talking about setting the bundle bit, it must be a FolderInfo, surely? In fact, it would be a good thing to check for a folder and error out if you don't get one.

Why yes, I suppose setting the bundle bit on a flat file doesn't make much sense ... conceptually, at least on Mac OS X. But I do not think in practice anything is wrong with the implementation. This would seem to be supported by the FSChangeFinderFlags function from MoreFilesX that Sean McBride was kind enough to point out.


3. I take it there is no Apple provided Cocoa API for this purpose. (At least, I couldn't find any.)
4. Is there otherwise anything wrong with this code, or anything I should be aware of?

I don't know that the finderInfo structure is byte-swapped when it's retrieved, even via FSGetCatalogInfo(). As a result, you might need to check whether you're on an Intel machine or not.

FSChangeFinderFlags doesn't do it, so I suppose it's ok. On the other hand since the code stems from 2005, maybe it is out of date. Anyone care to comment on this with any authority? (My gut tells me it's not a concern.)


António

-----------------------------------------
Forgiveness is not an occasional act;
it is a permanent attitude.

--Martin Luther King, Jr
-----------------------------------------




_______________________________________________

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: 
 >UTI's and document packages (From: Antonio Nunes <email@hidden>)
 >Re: UTI's and document packages (From: "Sean McBride" <email@hidden>)
 >Re: UTI's and document packages (From: Antonio Nunes <email@hidden>)
 >Setting the bundle bit [Was: Re: UTI's and document packages] (From: Antonio Nunes <email@hidden>)
 >Re: Setting the bundle bit [Was: Re: UTI's and document packages] (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: Code and Decode a CGContextRef
  • Next by Date: Re: Setting the bundle bit [Was: Re: UTI's and document packages]
  • Previous by thread: Re: Setting the bundle bit [Was: Re: UTI's and document packages]
  • Next by thread: Re: Setting the bundle bit [Was: Re: UTI's and document packages]
  • Index(es):
    • Date
    • Thread