File: iter.connection.R

package info (click to toggle)
r-cran-itertools 0.1-3-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 316 kB
  • sloc: makefile: 2
file content (14 lines) | stat: -rw-r--r-- 273 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
iter.connection <- function(obj, ...) {
  s <- summary(obj)

  if (s$opened != "opened")
    stop("connection not opened")

  if (s$`can read` != "yes")
    stop("connection not readable")

  if (s$text == "binary")
    ireadBin(obj, ...)
  else
    ireadLines(obj, ...)
}