How to test for the EOF flag in R?

eof, file, file-io, r

Solution

The readLines function will return a zero-length value when it reaches the EOF.

Problem

How can I test for the `EOF` flag in R? For example: ``` f <- file(fname, "rb") while (???) { a <- readBin(f, "int", n=1) } ```

Original source