io.stdout
Defined in module
"io"from "io" import stdoutThe process's standard output stream, already open as an io.file instance.
Notes
This is the same underlying stream that print and println write to, so output through stdout and through print interleaves in the order the calls happen, not in two separate streams.
stdout shares the process's handle rather than owning it, so close on it does nothing: the stream stays open and every method keeps working afterward, unlike a file opened by io.file itself.
Example
from "io" import stdout
println("via println")
stdout.writestring("via stdout.writestring\n") // same underlying stream as println
stdout.close() // shared, not owned: this is a no-op
stdout.writestring("still open after close\n")Output:
via println
via stdout.writestring
still open after closeSee also
stderr | The process's standard error stream, already open as an io.file instance. |
stdin | The process's standard input stream, already open as an io.file instance. |
writestring | Writes the string and returns the number of characters written |
close | Closes the file if it is still open |
| io | module index |