[R] Problem (Bug?) with readLines on Suze

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri May 7 10:12:30 CEST 2004


You asked R to read a binary file line-by-line, and it did its best.
Given that an incorrect operation resulted in an error message, it did 
reasonably well.

It looks to me as if end of directory is not being detected, and I'll dig 
deeper to see it that can be improved.

On Fri, 7 May 2004, Marc Mamin wrote:

> I called readLines on  Suze 9.0 with a directory as parameter instead of a file.
> R freezed for a very long time; this morning I could read following error message:
> 
> Error in readLines(paste("/home/",foo,"/",sep=""))  :  cannot allocate buffer in readLines
> 
> 
> under W2K I get a more logical error ("cannot open file")

That's because on Windows a directory is not a text file.  We could 
probably add such a check on Unix.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list