PHP Manual
Prev |  | Next

# php_stream_fopen_temporary_file

php_stream_fopen_temporary_file -- Generate a temporary file name and open a stream on it

## Description

php_stream * php_stream_fopen_temporary_file ( const char * dir, const char * pfx, char ** opened )

php_stream_fopen_temporary_file() generates a temporary file name in the directory specified by dir and with a prefix of pfx. The generated file name is returns in the opened parameter, which you are responsible for cleaning up using efree(). A stream is opened on that generated filename in "w+b" mode. The file is NOT automatically deleted; you are responsible for unlinking or moving the file when you have finished with it.

Prev | Home | Next
php_stream_fopen_tmpfile | Up | Streams Socket API Reference