[c++] How to create a std::ofstream to a temp file?
- by dehmann
Okay, mkstemp is the preferred way to create a temp file in POSIX.
But it opens the file and returns an int, which is a file descriptor. From that I can only create a FILE*, but not an std::ofstream, which I would prefer in C++. (Apparently, on AIX and some other systems, you can create an std::ofstream from a file descriptor, but my compiler…