View Single Post
Old Oct 10th, 2007, 12:22 PM   #1
Ade
Hobbyist Programmer
 
Ade's Avatar
 
Join Date: Oct 2004
Location: England, UK
Posts: 139
Rep Power: 0 Ade is an unknown quantity at this point
Setting location for a temp file

Hi,

I have got a script to create a temp file using:

($fh, $filename) = tempfile(SUFFIX => '.vcf');

Now you can set the location directory of this file using:

$dir = tempdir( CLEANUP => 1 );
($fh, $filename) = tempfile( $template, DIR => $dir);

But that puts the temp file in a directory in the /tmp directory. Something like:

/tmp/Ir9usvCuAr/GykBOCKgOc

My question is how can I set a directory to hold these new temp files somewhere else in the file structure? Somewhere like /home/me/public_html/thisplace_here/



Thanks for any advice
__________________
Don't wound what you can't kill
Ade is offline   Reply With Quote