[Issue 13996] Function for returning a temporary file with a randomly generated name where the name can be accessed

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Feb 3 18:17:43 PST 2015


https://issues.dlang.org/show_bug.cgi?id=13996

--- Comment #4 from Martin Nowak <code at dawg.eu> ---
(In reply to Jonathan M Davis from comment #3)
> auto file = File.tempFile();
> scope(exit) std.file.remove(file.name);

There is a security aspect, because the current tempfile is unlinked at the
moment it's created. So no other process can access it.
But as that's the advanced use-case it deserves the longer name, anonTempFile
or so.

--


More information about the Digitalmars-d-bugs mailing list