Skip to content
Prev 50385 / 63424 Next

Reading exit code of pipe()

Is there a way to get the status code of a pipe() command? The
documentation suggests that it might be returned by close, however
this does not seem to be the case.

  con <- pipe("cat /etc/passwd", "r")
  stream <- readLines(con, n = 10)
  err <- close(con)
  print(err)