No tempFile() in std.file

bachmeier via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 16 07:32:58 PDT 2017


On Tuesday, 16 May 2017 at 13:56:57 UTC, Jonathan M Davis wrote:

> std.file doesn't have anything to do with File. It only 
> operates on entire files at a time, so it wouldn't make sense 
> for a function in std.file to return a std.stdio.File. At most 
> what would make sense to me would be to have a function in 
> std.file which created the file as empty and closed it and then 
> returned the file name for the program to then open or do 
> whatever else it wants with - which would actually be perfectly 
> fine if you then wanted to use std.file.write or similar to the 
> file. It's just more annoying if you want a File, because then 
> you end up effectively opening the file twice.
>
> - Jonathan M Davis

Okay, now I see your point. Your proposal is still a lot better 
than doing nothing.


More information about the Digitalmars-d-learn mailing list