FAQ
Schwern wrote...
There's only so far CGI.pm can bend trying to guess the location of a
temp directory. Rather than growing an already long list, you could
just set the TMPDIR environment variable. The helpful side effect of
this is lots of other programs and modules use that.

Ideally CGI.pm should use the Windows GetTempPath API.
Well, a simpler approach is to use $ENV{TEMP} or $ENV{TMP} isnt it? Both of
these vars should be set on a Windows system afaik. Of course using the
Windows API is better, but IMO its pretty much of a muchness. (Especially as
I don't see GetTempPath() exposed through the normal Win32 modules, and thus
using it would require use of Win32::API which is probably undesirable for
File::Spec)
Instead of CGI.pm having to hard code any platform specific
temp dir code,
it should probably just use File::Spec->tmpdir.

On a side note, File::Spec::Win32::tmpdir() is not using the
Win32 API to find the temp directory.
A quick check shows it uses the correct ENV vars though. But it will ignore
them under tainting. Something that I think is probably wrong. It should
probably detaint and verify the directory exists and then be happy.

Yves

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-porters @
categoriesperl
postedJul 8, '04 at 7:05p
activeJul 8, '04 at 7:05p
posts1
users1
websiteperl.org

1 user in discussion

Orton, Yves: 1 post

People

Translate

site design / logo © 2023 Grokbase