On Thu, May 14, 2015 at 7:30 AM, William Dunlap 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
Not sure if it helps for your use case, but I have an experimental package
for controlling bidirectional pipe streams from R. Just thought I'd mention
it. Its at
https://github.com/thk686/pipestreamr
THK
On Thu, May 14, 2015 at 9:30 AM, William Dunlap wrote:
> The difference in the return valu
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)
> con <- pipe("ls")
> open(con, "r")
> readLines(con, n=1)
[1] "1032.R"
> print(close(con))
NULL
On Thu, May 14, 2015 at 1:27 AM, Kevin Ushey wrote:
[...]
> So maybe `cat` just doesn't set a status code, and so there's nothing
> for R to forward back (ergo -- NULL)?
>
cat definitely sets the status. IMHO every command sets the exit status, by
definition, at least on Unix/Linux.
/tmp$ touch
Hi Jeroen,
I think `pipe` might just be returning the status code of the
underlying command executed; for example, I get a status code of '0'
when I test a pipe on `ls`:
conn <- pipe("ls")
stream <- readLines(conn)
print(close(conn))
Similarly, I get an error code if I try to `ls` a