From: Jamie C. <jca...@we...> - 2004-07-21 08:30:00
|
The best solution is to use Webmin's tempname function, which will return a filename under /tmp/.webmin suitable for use as a temporary directory. Your code would look something like : $tempdir = &tempname(); mkdir($tempdir, 0700); $tempfile = "$tempdir/whatever"; ... system("rm -rf ".quotemeta($tempdir)); The only important thing to remember is to remove the temporary directory before your script exits, as the rm -rf command above does. Otherwise, you run the risk of filling up the filesystem with data that is no longer needed .. - Jamie On Wed, 2004-07-21 at 08:14, Sandro Dentella wrote: > I need to use temporary files. Where should I put them? > I'm writing an interface to manage dar archives from backup. People look in > a database find the precious file and click on it. File must be extracted > from the archive and served. Where should I extract it. > > Of course it would work, creating a temp dir *inside* > /usr/share/webmin/my_module.... but that would be against any Filesystem > Hyerarchy Standard. > > Otherwise I should create a wrapper cgi that picks file that I extract under > /tmp/ os /var/tmp, is there any other, possibly smarter solution? > > > TYA > sandro > *:-) > > |