Saving Files Under Windows

Tim Golden tim.golden at viacom-outdoor.co.uk
Tue Jun 17 07:18:29 EDT 2003


Tim Golden <tim.golden at viacom-outdoor.co.uk> wrote in message news:<mailman.1055781148.14465.python-list at python.org>...
> achrist at easystreet.com> This looks to be exactly what I need, if I can get
> it to work ...
> achrist at easystreet.com> Are these not portable to WinNT?  On NT 4.0 SP6,  I
> get:
> 
> [snip error messages]
> 
> Ahh. I rather thought that the win32 shell stuff was universal (on win32, at
> least). I don't have an NT4 box here, so I'll have to try it when I get
> home. Can anyone else confirm, or cast light on this?
> 
> TJG

Answering myself...

WinNT (and maybe Win95) don't support SHGetSpecialFolderPath directly;
instead, you have to use SHGetSpecialFolderLocation and then
SHGetPathFromIDList. If you wish, have a butchers at my winshell
module (http://tgolden.sc.sabren.com/python/winshell.html), a
convenience wrapper round these sort of things. If nothing else, you
can look at the code and see what I'm talking about.

Since Win2K (and maybe Win98) also support the two-level SHGet...,
I've recoded my module to use that rather than try to do
platform-specific juggling, which smacks of browser-sniffing a little
too much for my liking.

TJG




More information about the Python-list mailing list