tmpnam filename
| From: | Rus Foster | Date: | Thu, 29 Aug 2002 10:18:42 +0000 |
| Subject: | tmpnam filename | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-114488@lists.php.net to get a copy of this message | ||
Hi All,
I'm fairly new to this list/PHP and I've already hit a bit of a brick
wall. I'm trying to write some data out to a temporary file then make a
passthru call so that another program can take the file as input on the
command line
I first tried
print "<p>Do stuff</p>";
$temp = tmpfile();
fwrite($temp, $text);
passthru("/path/to/program $temp");
fclose($temp); // this removes the file
However I realised that $temp was a file handle rather than a filename. Is
there anyway I can get the filename? A google and search on php.net
doesn't show anything obvious
Rgds
Rus
--
http://www.fsck.me.uk - Rant wibble wave
http://shells.fsck.me.uk - Hosting and stuff