Quirrel4.41.0

io.stdout

Defined in module "io"
from "io" import stdout

The 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

examples/io/stdout.nut
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 close

See also

stderrThe process's standard error stream, already open as an io.file instance.
stdinThe process's standard input stream, already open as an io.file instance.
writestringWrites the string and returns the number of characters written
closeCloses the file if it is still open
iomodule index