Secure temporary file: Difference between revisions

added php
(added php)
Line 29:
fclose(fh);
/* The C standard library also has a tmpnam() function to generatecreate a filenamefile
for you to open later. But you should not use it because someone else might
be able to open the file from the time it is created by this function to the
Line 114:
print $fh->filename, "\n";
close $fh;</perl>
 
=={{header|PHP}}==
<php>$fh = tmpfile();
// do stuff with $fh
fclose($fh);
// file removed when closed
 
// or:
$filename = tempnam('/tmp', 'prefix');
echo "$filename\n";
// open $filename and do stuff with it</php>
 
=={{header|Python}}==
Anonymous user