Temporary File Creation

Stanislav Blinov stanislav.blinov at gmail.com
Mon Jun 22 23:53:41 UTC 2020


On Monday, 22 June 2020 at 21:46:57 UTC, Per Nordlöw wrote:
> Has anybody written a procedure for creating a temporary file 
> in a race-free manner?
>
> And why has such a procedure not already been added to std.file 
> when std.file.tempDir has?
>
> See: https://dlang.org/library/std/file/temp_dir.html

tempDir just returns a path (i.e. "/tmp" or whatever it is on 
Windows, etc.), it doesn't create anything.

Given the synopsis of std.file, a procedure for *creating* a file 
doesn't belong there, as it would only be half of an operation.

There is a https://dlang.org/library/std/stdio/file.tmpfile.html


More information about the Digitalmars-d-learn mailing list