Displaying 1 result from an estimated 1 matches for "timeout00".
Did you mean:
timeout01
2012 Jan 13
0
WISHLIST: Be able to timeout readline()/stdin via setTimeLimit in all consoles
...rdless on console, I'd like to be able to timeout a call to
readline()/file("stdin", blocking=TRUE) via setTimeLimit.
OBSERVATION:
On Windows Rterm as well as plain R on Linux, setTimeLimit() does not
momentarily interrupt from stdin, but only after hitting RETURN. A
few examples:
timeout00 <- function() {
setTimeLimit(elapsed=5);
Sys.sleep(10);
}
timeout01 <- function() {
setTimeLimit(elapsed=5);
readline();
}
timeout02 <- function() {
setTimeLimit(elapsed=5);
con <- file("stdin", blocking=TRUE);
on.exit(close(con));
readChar(con, nchars=1);
}...