Hi David,
No insult was intended to anyone, and I was not trolling. Apologies if I
came over that way. Please put it down to frustration. I am NOT skilled
in ruby yet, and finding the problem has proved very trying.
Please don't just stand there and crack the whip. I can promise you
that it is not going to turn out that you will have been the one to
introduce these ideas to the Ruby world. We haven't just been sitting
around with our mouths open staring at the wall waiting for someone to
tell us we need to make an effort. If you want to join the efforts,
please do. But please don't preach at this level. (Unless you're
trolling, but I'm giving you the benefit of the doubt.)
The problem was that I did not have a d:/tmp directory. (The
installation script had not created it).
Looking deeper, the problem appears to be to do with the establishing a
temp directory in CGI context. ENV is tainted (I don't understand why?
ENV comes from the set up not the web).
In tmpdir.rb. the code is looking in places for the temp directory, that
do not apply to Win 2K. (IIRC they apply to win95/98), and thus leaving
@@systmpdir = '/tmp'. Then, because $SAFE is at 1, the Dir::tmpdir
method returned this wrong value.
Then the wrong value is stomped on by module BugFix, in
tempfile_bugfixed.rb line 28. (In
ruby\lib\ruby\gems\1.8\gems\rubyzip-0.5.5\zip) because the result was
tainted.
I corrected this, and yet it still uses /tmp. I have not found where
this is stomped on.
I altered the defaults in cgi_process.rg line 40 where it sets the
default options. This did not help. The "fix" I have not found makes
options invalid.
I also get an error
D:/ruby/lib/ruby/gems/1.8/gems/rubyzip-0.5.5/./zip/zip.rb:11: warning:
already initialized constant Tempfile. I don't know why, but I suspect
it is relevant.
So it appears we have a bug in code that is coding round a bug, in code
coding round a bug, that was triggered by an omission in an install
script!
As another contributor has remarked, problems for new uses are problems
for Ruby.
I also found that Webrick sets its tempdir (I think correctly) with the
line
:TempDir => ENV['TMPDIR']||ENV['TMP']||ENV['TEMP']||'/tmp',
Can code using Apache do something similar? I do not know Ruby well
enough yet to fix this (other than by creating the directory, which I
have done). Neither do I have the kit to test a patch on.
Regards
Ian