[R] File end in binary connection

Sven Garbade garbade at psy.uni-muenchen.de
Thu Jan 24 18:31:22 CET 2002


Hi,

I need to read to the file end of a binary file connection. My idea is
to do this in a while loop: while(actual.position < file.size) readBin()
... How can I determine the file size?

> p9lr
   description          class           mode           text        
opened 
"p9lr_all.mea"         "file"           "rb"       "binary"      
"opened" 
      can read      can write 
         "yes"           "no" 

> seek(p9lr, 0, "end")
[1] 0

> seek(p9lr)
[1] 0

Looks for me that seek() doesn't re-position the connection, or have I
missed something?. R version 1.4.0 on Linux i386.


Thanks, Sven
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list