Date: Mon, 6 Sep 2021 19:14:28 +0000 (UTC)
As far as I can see there is no standard way to get a temporary file as a C++ stream. ( Temporary file, as in a unique file which won't affect other files on the system) I looked at std::filesystem but there seems no function there to do it
In Linux I can use tmpnam, but that gives warnings in gcc that it isnt safe to use, since there is an outside chance the name will be taken by another file before opening. Only other temporary file functions I can find all return C file handles
The stackoverflow answer just suggests you roll your own. Is that the only option?
https://stackoverflow.com/questions/46417264/assigning-a-c-file-handle-to-c-file-stream
In Linux I can use tmpnam, but that gives warnings in gcc that it isnt safe to use, since there is an outside chance the name will be taken by another file before opening. Only other temporary file functions I can find all return C file handles
The stackoverflow answer just suggests you roll your own. Is that the only option?
https://stackoverflow.com/questions/46417264/assigning-a-c-file-handle-to-c-file-stream
Received on 2021-09-06 14:15:14