[Pythonmac-SIG] How do you use macfs.FInfo?

Ben Sayer bsayer@home.msen.com
Sat, 9 Oct 1999 21:45:29 -0400


On Sat, Oct 9, 1999, Richard Gordon <richard@richardgordon.net> wrote:

>Anyway, naturally I'm now stuck. I gathered that what I wanted to use 
>was macfs.FInfo, but I have yet to figure it out. The Python 
>documentation deals with this in Sec. 7.3 and says that the FInfo 
>Objects include:
>
>Creator
>        The 4-character creator code of the file.
>
>That's all well and good, but when I try to use this, I just get
>
>>>> macfs.FInfo(thefile)
><FInfo object at 300e0c0>

You need to use the macfs module, create an FSSpec object for the file,
then use the SetCreatorType method of the file's FSSpec object. For example:

import macfs

offs = macfs.FSSpec('sample.jpg')
offs.SetCreatorType('JVWR', 'JPEG')

>I'd appreciate any explanations about this and, while we're at it, 
>what's the deal with FInfoType?

My documentation states that the Finfo method creates a zero-filled FInfo
object. This is clearly not what you want. I'm not sure what one would
use the FInfo object type for, but I'm new to Mac programming too.

--Ben