Check Connection

DESCRIPTION:

Check the status of a connection, either if input is ready to read or if the connection is open.

USAGE:

inputWaiting(connection, timeout=0)
isOpen(connection, rw="")

ARGUMENTS:

connection
a connection object, as returned by open(), file(), etc.
timeout
the call to inputWaiting() will wait timeout seconds before returning, or will return as soon as input is waiting on the connection.
rw
used by the function isOpen() to detemine the return value. If "", the file can be open for either reading or writing; "r", open for reading; "w", open for writing; and "rw", open for both reading and writing.

VALUE:

The functions return TRUE or FALSE according to the condition they test: for isOpen() whether the connection is currently open for this purpose, for inputWaiting() whether there is input ready to read.

SEE ALSO:

, .

EXAMPLES:

while(inputWaiting(myPipe)) 
{ 
nextLine <- readLines(myPipe) .... 
}