Functionstmpfile () says that:
The created temporary file is automatically deleted when the stream is closed (fclose) or during normal operation of the program. If the program is abnormally interrupted, whether the file is deleted depends on the particular system and library implementation. "
Functiontmpfile () returns a stream pointer to the generated temporary file, not the file path. I need a temporary path to the file name, since it needs to pass another library function to it.
My application may crash, so the tmpfile () function may work here if the output fails.
How can I get the temporary path to the file and delete the file automatically on exit
user6038872
source
share