Run child process with null stdin/stdout

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 19 08:26:05 PDT 2014


On Wed, 18 Jun 2014 16:15:40 -0400, David Nadlinger <code at klickverbot.at>  
wrote:

> On Wednesday, 18 June 2014 at 20:00:43 UTC, Justin Whear wrote:
>> For POSIX, seems like you could pass `File("/dev/null", "r")` for stdin
>> and `File("/dev/null", "w")`.  On Windows I believe you can use `File
>> ("nul")` for the same effect.
>
> Implementing this myself is of course always an option, yes, but I would  
> have liked to avoid platform-dependent code.
>
> Hm, I just checked the source, and there doesn't seem to be a better  
> option indeed…
>

I think a mechanism to open a null stream in an OS independent way would  
be a good addition to std.stdio (or perhaps std.process?)

-Steve


More information about the Digitalmars-d-learn mailing list