C++: Getting a temporary file, cross-platform

I'm looking for a cross-platform way of getting designated a temporary file. For example in linux that would be in the /tmp dir and in Windows in some crappy named Internet Explorer temp dir.

Does a cross-platform (Boost?) solution to this exist?

EDIT:

I need this file to exist until the program terminates. tmpfile() does not guarantee that. Quoting from ccpreference:

The temporary file created is automatically deleted when the stream is closed (fclose) or when the program terminates normally.

41
задан Mike 20 May 2014 в 07:51
поделиться