[Pythonmac-SIG] Re: Per user dirs on Non-Unix platforms (was Re: [Python-Dev] Where to install non-code files)
Jack Jansen
jack@oratrix.nl
Mon, 29 May 2000 23:56:53 +0200
Okay, from all the bits of knowledge imparted by the various
contributors (thanks! this was all news to me!) I think we can safely
assume that the following code will work under all macos versions,
regardless of whether they're multiuser, 8, 9, X or whatever:
vrefnum, curdir = macfs.FindFolder(-1, 'pref', 0)
fss = macfs.FSSpec((vrefnum, curdir, 'myapplication preferences'))
filename = fss.as_pathname()
and if you're feeling fancy you can use the kOnSystemDisk constant for
'-1' and the kDontCreate for 0 (or something like that).
BTW: I doubt that MacOS9 actually copies the preferences folder
around, as someone suggested, I would guess that it simply adjusts the
value returned by FindFolder. Programs that don't use FindFolder but
hardcoded pathnames get stomped on rather seriously in non-US MacOS
versions since about 1992, so I don't think there's many of them left.
--
Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm