On Thu, May 14, 2015 at 7:30 AM, William Dunlap <wdun...@tibco.com> wrote: > The difference in the return value of close(pipeConnectionObject) seems to > depend on whether the pipe connection was opened via the pipe() or open() > functions (close() returns NULL) or via something like readLines() or scan() > (close() returns status integer).
Hmm interesting. It doesn't help me though; the connection has to be explicitly opened to support streaming otherwise it keeps running the command over and over again: con <- pipe("ls -ltr /") readLines(con, n = 3) readLines(con, n = 3) readLines(con, n = 3) isOpen(con) Under the hood, R distinguishes "closing" and "destroying" the connection. The R function close actually means destroy. It seems like the pipe exit code is only properly returned if the connection was already closed but not destroyed by the time close() was called. ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel