Win32\'s CreateFile has FILE_FLAG_DELETE_ON_CLOSE, but I\'m on Linux.
I want to open a temporary file which will always be deleted upon program terminat
In the past, I have build a "temporary file manager" that kept track of temporary files.
One would request a temporary file name from the manager and this name was registered.
Once you don't need the temporary file name any more, you inform the manager and the filename is unregistered.
Upon receipt of a termination signal, all the registered temporary files were destroyed.
Temporary filenames were UUID based to avoid collisions.