Developer Resources

ProcessOutputStream

Overview

The ProcessOutputStream class allows the caller to access the stdout and stderr output streams of a process.

Methods

ProcessOutputStream.eof
Determines if the end of the stream has been reached
ProcessOutputStream.readLine
Read a single line from a text file

ProcessOutputStream.eof

function ProcessOutputStream.eof() : Boolean

Returns

A boolean value indicating whether the end of the stream has been reached.

Description

When reading the stream, it is often necessary to determine when the end has been encountered. Calling eof() returns true if the process has terminated and there are no lines left in the input buffer. If the process is still running, eof() will always return true. If the process has terminated, eof() will return true if there are any pending lines in the buffer.

ProcessOutputStream.readLine

function ProcessOutputStream.readLine() : String

Returns

A string containing the line read from the input stream. If an error or end-of-file condition was encountered, null is returned.

Description

Reads a single line from a process output stream. The file pointer is automatically advanced to the next line. A string containing the line read is returned, and does not include the carriage return or line-feed character. If data is not yet available for reading, or an end-of-file (eof) condition has been reached, null is returned. See eof() for more details.