Function in io compiler

stderr

fn stderr() -> Stream
Import
use io::{stderr};
Source: compiler/src/builtin_docs/io.hy

Returns a new stream on the process’s standard error.

The stream holds a duplicated descriptor, so closing it does not close the process’s stderr.

Returns#

Stream

Examples#

use io::{stderr, write};
use string::{to_bytes};
use tests::assert;
let n = match write(stderr(), to_bytes("")) {
    Result::Ok(n) => n,
    Result::Err(_) => -1,
};
assert!(n == 0);

See also#

  • stdin: Returns a new stream on the process’s standard input.
  • stdout: Returns a new stream on the process’s standard output.
  • capture_begin: Starts keeping this thread’s stdout and stderr writes in memory instead of writing them, until the matching capture_end().
  • capture_end: Ends the innermost capture_begin() and returns what it kept, as (stdout, stderr).
  • open: Opens the file at path with mode and returns a stream on it.
  • close: Closes s.
  • read: Reads bytes from s into the front of buf without waiting.
  • write: Writes bytes from buf to s without waiting and returns how many were written.
↑ ↓ navigate ↵ open