[Pythonmac-SIG] Docs for Carbon.file??
Jack.Jansen at cwi.nl
Thu Jul 31 01:32:29 EDT 2003
On donderdag, jul 31, 2003, at 00:21 Europe/Amsterdam, Chris Barker
> Hi folks,
> Are there any docs for the Carbon.File module (and the rest of the
> Carbon Package).
> I'm not much of a mac programmer (Python is the only language I've
> ever programmed on the Mac with), so all this Mac stuff is a mystery
> to me.
Use the Apple documentation. If you have installed the developer tools
you have it, and it's even searchable from within the IDE (although
that may not be the best way to approach it:-).
> In any case, I need to set the type and creator of a file just created
> by my program. Poking around, I found that this appears to work:
> import Carbon.File
> mac_file = Carbon.File.FSSpec(filepath)
> info = mac_file.FSpGetFInfo()
> info.Creator = "COSM"
> info.Type = ".SAV"
> I figured this out by trying things out, I couldn't find any docs.
> What I have seems to work, but it also seems a whole lot clunkier that
> it should be. Is there an easier way?
Carbon.File strictly follows the Apple API's, so the documentation and
the Python code match. For this specific case there is
MacOS.SetCreatorAndType(file, creator, type). This call is documented,
see the Mac section of the Python documentation.
- Jack Jansen <Jack.Jansen at oratrix.com>
- If I can't dance I don't want to be part of your revolution -- Emma
More information about the Pythonmac-SIG