No tempFile() in std.file

H. S. Teoh via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 16 08:10:42 PDT 2017


On Tue, May 16, 2017 at 08:06:13AM -0700, H. S. Teoh via Digitalmars-d-learn wrote:
> On Tue, May 16, 2017 at 06:56:57AM -0700, Jonathan M Davis via Digitalmars-d-learn wrote:
> > On Tuesday, May 16, 2017 11:19:14 bachmeier via Digitalmars-d-learn wrote:
> > > On Monday, 15 May 2017 at 22:38:15 UTC, Jonathan M Davis wrote:
> > > > I suppose that we could add a tempFile that did what
> > > > std.stdio.File.scratchFile did but create an empty file and return
> > > > its path rather than returning a File, though that would be a bit
> > > > annoying, since you'd then have to open it to operate on it
> > > > instead of just writing to it. Maybe it would be worth doing
> > > > though given the stupidity blocking std.stdio.File.scratchFile.
> [...]
> 
> Don't forget that there are security concerns related to this.
[...]

Cf.:
	https://cwe.mitre.org/data/definitions/377.html
	https://cwe.mitre.org/data/definitions/378.html
	https://security.stackexchange.com/questions/34397/how-can-an-attacker-use-a-fake-temp-file-to-compromise-a-program
	https://security.openstack.org/guidelines/dg_using-temporary-files-securely.html


T

-- 
A bend in the road is not the end of the road unless you fail to make the turn. -- Brian White


More information about the Digitalmars-d-learn mailing list