Stdin[T]
The process's standard input.
Obtained as shell.stdin.
Every handle reads through one shared buffered reader, so mixing iteration
with read picks up exactly where the other left off.
What differs between handles is only how they frame that stream.
A function that accepts an Io, such as
compress.decompress, reads through the same reader.
Inherits from: std.Iter[T], io.Io
Fields
readable @ Bool[get]Whether the stream reads, which it always does.
Methods
(eq) other -> Bool
Compares two handles, which are equal when they frame the stream the same way.
Parameters
| Name | Type | Description |
|---|---|---|
other |
Value |
(iter)() -> Stdin[T]
Iterates the stream, yielding lines by default.
A line includes its terminator, so chomp is
how you ask for one without:
(next)() -> T
Yields the next line or chunk.
chunks … -> Stdin[Bin]
Returns a handle that yields Bin chunks of at most size
bytes, as much as each read returns.
Parameters
| Name | Type | Description |
|---|---|---|
size? |
Int |
Most bytes per chunk. 65536 by default. |
Example
close()
Does nothing: the process's input stays open.
lines() -> Stdin[Str]
Returns a handle that yields lines.
This is the default framing, so it is only needed to undo a previous
chunks.
read … -> Bin
Reads raw bytes.
With a size this is a single read, which may return fewer bytes than
asked for, as fs.BaseFile.read does. Without one it
reads to end of stream.
Parameters
| Name | Type | Description |
|---|---|---|
size? |
Int |
Maximum bytes to read. Unbounded when omitted. |
Returns
An empty value at the end of the stream.