FileStream

OutputFileStream: OutputFileStream, ~OutputFileStream, write, writeln

Functions: stdout, stderr

struct OutputFileStream

Writes formatted output to a file.

OutputFileStream

OutputFileStream(public int fileDescriptor)

Opens the given file descriptor for writing.

~OutputFileStream

~OutputFileStream()

Closes the file.

write

void write<T: Printable>(T& value)

Writes the given value to the file without allocating.

writeln

void writeln<T: Printable>(T&... args)

Writes the given values to the file, followed by a newline. Each write is flushed, unlike println, so output appears live when redirected.

stdout

OutputFileStream stdout()

Returns a stream writing to standard output.

stderr

OutputFileStream stderr()

Returns a stream writing to standard error.