capture_end
fn capture_end() -> (string, string) Import
Source: use io::{capture_end}; compiler/src/builtin_docs/io.hy Ends the innermost capture_begin() and returns what it kept, as (stdout, stderr). Both are empty when no capture is open.
Returns#
(string, string)
Examples#
use io::{capture_begin, capture_end, stderr, write};
use string::{to_bytes};
use tests::assert;
capture_begin();
let _ = write(stderr(), to_bytes("oops"));
let (_, err) = capture_end();
assert!(err == "oops");
See also#
io::capture_beginstdin: Returns a new stream on the process’s standard input.stdout: Returns a new stream on the process’s standard output.stderr: Returns a new stream on the process’s standard error.open: Opens the file atpathwithmodeand returns a stream on it.close: Closess.read: Reads bytes fromsinto the front ofbufwithout waiting.write: Writes bytes frombuftoswithout waiting and returns how many were written.