[Issue 12815] New: Dummy file
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed May 28 04:57:45 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12815
Issue ID: 12815
Summary: Dummy file
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: Phobos
Assignee: nobody at puremagic.com
Reporter: maximzms at gmail.com
It would be nice to have a file similar to stdout or stderr that does nothing,
say, stdnull.
It is useful when one needs to suppress some output (e.g. when --silent flag is
sent to the program).
On Linux the following code does the trick:
--------------------
File stdnull;
static this()
{
version(Posix)
{
stdnull = File("/dev/null", "w");
}
}
--------------------
What about other systems?
--
More information about the Digitalmars-d-bugs
mailing list