stdin
fn stdin() -> Stream Import
Source: use io::{stdin}; compiler/src/builtin_docs/io.hy Returns a new stream on the process’s standard input.
The stream holds a duplicated descriptor, so closing it does not close
the process’s stdin. Like every stream it is non-blocking: read
returns Err(IoError::WouldBlock) until input is available. Use
io::sync::read_line or read_to_end to wait for input.
Returns#
Stream
Examples#
use io::{close, stdin};
use tests::assert;
let s = stdin();
let closed = match close(s) {
Result::Ok(_) => true,
Result::Err(_) => false,
};
assert!(closed);
See also#
io::readio::sync::read_linestdout: Returns a new stream on the process’s standard output.stderr: Returns a new stream on the process’s standard error.capture_begin: Starts keeping this thread’s stdout and stderr writes in memory instead of writing them, until the matchingcapture_end().capture_end: Ends the innermostcapture_begin()and returns what it kept, as(stdout, stderr).open: Opens the file atpathwithmodeand returns a stream on it.close: Closess.