process.stderr_read

process.stderr_read

process.stderr_read

Function

Reads the text currently available on stderr of the started child process.

Syntax

Parameters

No parameters.

Return value

TypeDescription
StringReturns the stderr text read this time; the first read of the real zero-byte output of the child process returns ''.
EmptyThe child process has not been started, there is no stderr pipe, there is no new data within the timeout, or the pipe has been closed and the remaining data has been read.

Example

Notes

  • stderr_read() returns at most BT_PROCESS_PIPE_READ_CHUNK bytes; it can be called repeatedly when more output needs to be read.
  • stderr and stdout calculate the unread buffer limit respectively.
  • The default BT_PROCESS_PIPE_LIMIT is 1048576 bytes, BT_PROCESS_PIPE_READ_CHUNK is 8192 bytes, and BT_PROCESS_PIPE_TIMEOUT_MS is 100 milliseconds; a single Process can use pipe_limit(bytes) to override the unread buffer limit.
  • BT_PROCESS_PIPE_LIMIT limits the current unread buffer and does not limit the historical cumulative output; as long as reading continues, the long-term error stream can exceed 1MB of total output.