Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: CGI open of tmpfile

by tune (Curate)
on Oct 22, 2002 at 12:30 UTC ( [id://207051]=note: print w/replies, xml ) Need Help??


in reply to CGI open of tmpfile

If you have your temp dir on an unordinary place, just do this:
BEGIN { $TempFile::TMPDIRECTORY = '/mytmp' } use CGI;
Or edit your CGI.pm in the right place:
# HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES. # UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING. # $TempFile::TMPDIRECTORY = '/usr/tmp';

--
tune

Replies are listed 'Best First'.
Re: Re: CGI open of tmpfile
by rdfield (Priest) on Oct 22, 2002 at 13:15 UTC
    I don't think that this is particularly good advice. Please correct me if I am wrong, but the CGI docs clearly state that temp dirs are found in the following order:
    • ~user/tmp
    • $ENV{TMPDIR}
    • the usual suspects (/usr/tmp, /var/tmp, C:\temp, /tmp, /temp, ::Temporary Items, and \WWW_ROOT)
    I don't see any mention of it looking at the value of $TempFile::TMPDIRECTORY (whatever that might be) and I certainly wouldn't recommend anyone start hacking CGI.pm.

    rdfield

      You are right. But what if he or his sysadmin created another tmp directory, and disabled all the places, where CGI.pm looks after? I don't think that's impossible. What can he do then instead of hacking?

      --
      tune

        $ENV{TMPDIR} = '/some/writable/directory';?

        rdfield

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://207051]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-03-28 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found