Why do you use tmpfile and not tempnam, as you write it in the header of
your message ? it returns the name of the file, as you expect...
string tempnam ( string dir, string prefix)

Then, you'll just need to open the file returned by tempnam and write all
data inside...

regards

Eric



"Rus Foster" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> 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
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to