IO Streams
License
Boost License 1.0.
Authors
Jason White
Description:
Provides access to the standard I/O streams: stdin, stdout, and stderr. Note that each of these streams are buffered.

To avoid conflict with std.stdio, the file handles of each stream are duplicated on static construction and closed upon static destruction.

File  stdin;

Standard input stream.

Example:
Counting the number of lines from standard input.
import io;
size_t lines = 0;
foreach (line; stdin.byLine)
    ++lines;

File  stdout;

Standard output stream.

Example:
import io;
stdout.write("Hello world!\n");
stdout.flush();

File  stderr;

Standard error stream.

 stderr is often used for writing error messages or printing status updates.

Example:
Prints a useful status message.
import core.thread : Thread;
import core.time : dur;

immutable status = `|/-\`;

for (size_t i = 0; ; ++i)
{
    Thread.sleep(dur!"msecs"(100));
    stderr.write("Reticulating splines... ");
    stderr.write([status[i % status.length], '\r']);
    stderr.flush();
}