On Wednesday, 17 May 2017 at 05:30:40 UTC, Patrick Schluter wrote:
On Tuesday, 16 May 2017 at 13:56:57 UTC, Jonathan M Davis wrote:
[...]
As your solution doesn't inherently solve the race condition
associated with temporary files, you could still generate the
name with a wrapper around tempnam() or tmpnam() (Posix for
Windows I don't know). This would avoid the double open() of
the scenario above.
But as Jonathan said above, this is not a good solution in any
case. In Posix the use the mks*temp() family of functions is
standard now.