[Pythonmac-SIG] eps + pict preview

Michael Hudson mwh at python.net
Tue Aug 5 12:58:59 EDT 2003


Robin Becker <robin at reportlab.com> writes:

> Hi, I apologise in advance if this is a stupid question from a non mac
> user, but how do I create a file with a resource fork?

Assuming you have a FSSpec or something,
Carbon.File.FSpCreateResourceFork or similar is your friend.  Then you
need to create a resource

r = Res.Resource(<data>)

and add it to the resource fork

r.AddResouce(type, id, name)

(this adds it to the "current resource file" or whatever).

I'm not really competent to give a tutorial in the Resource Manager,
but HTH.  Apple's documentation isn't that hard to translate to
Python.

Cheers,
mwh

-- 
93. When someone says "I want a programming language in which I
    need only say what I wish done," give him a lollipop.
  -- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html



More information about the Pythonmac-SIG mailing list