No tempFile() in std.file

Patrick Schluter via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 16 22:34:50 PDT 2017


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.


More information about the Digitalmars-d-learn mailing list