code_junkie

How to test for the EOF flag in R?

Nov 11th, 2011
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. f <- file(fname, "rb")
  2. while (???) {
  3. a <- readBin(f, "int", n=1)
  4. }
  5.  
  6. while (length(a <- readBin(f, 'int', n=1)) > 0) {
  7. # do something
  8. }
Add Comment
Please, Sign In to add comment