[Pythonmac-SIG] Creating resource files

Mark Day mday@mac.com
Wed, 19 Mar 2003 11:33:19 -0800


On Wednesday, March 19, 2003, at 03:00  AM, Michael Hudson wrote:

>> It looks like you can pass those as the last two parameters to
>> Carbon.File.FSRef.FSCreateFileUnicode in Python, though I haven't
>> tried it myself.
>
> And which bits of the FSCatalogInfo do you need to frob in C?
> finderInfo?  That's just documented as an UInt8[16] or something,

Yup, use the finderInfo.  It's really either FileInfo or FolderInfo 
(both from Finder.h), depending on whether the object is a file or 
folder.  Similarly, extFinderInfo is really either ExtendedFileInfo or 
ExtendedFolderInfo.  I think there was some circular header dependency 
that prevented Files.h from using the Finder types explicitly.

> and doesn't seem to be exposed to Python...

Yeah, finderInfo, extFinderInfo and textEncodingHint don't seem to be 
exposed in Carbon.File.FSCatalogInfo.

I can see finderInfo and extFinderInfo being tough because you don't 
know whether to use FileInfo or FolderInfo without knowing whether it 
will be associated with a file or directory.  Perhaps there should be 
two attributes for each of finderInfo and extFinderInfo (such as 
"fileInfo", "folderInfo", "extendedFileInfo", "extendedFolderInfo").  
The fileInfo and folderInfo attributes would both access the 
finderInfo; extendedFileInfo and extendedFolderInfo would both access 
the extFinderInfo.

-Mark