[Rd] cat cannot write more than 10000 characters? [R 2.8.1]
Prof Brian Ripley
ripley at stats.ox.ac.uk
Mon Jan 5 10:31:16 CET 2009
On Sun, 4 Jan 2009, Daniel Sabanés Bové wrote:
> during the examination of a Sweave hang-up inside an odfWeave call (OOo
> XMLs have looong lines) I have discovered that my cat function cannot
> write more than 10000 characters to a text file. Otherwise, the internal
You mean on a single line?
> C code causes a hang-up, which can only be stopped with a quit signal
> that terminates the R session. Is this behavior normal?
No, works for me on Mac OS X and x86_64 Fedora 8 (as does 10x larger).
Can you run this under a debugger and find where it is going wrong for
> Code to reproduce this:
> testChunk <- paste(rep("a", 10000 + 1), ## delete "+ 1" to be successful
> output <- tempfile()
> cat(testChunk, sep = "\n", file = output, append = TRUE)
We have writeLines() for that and it is more efficient, especially if you
keep a connection open.
> My sessionInfo:
> R version 2.8.1 (2008-12-22)
> i686-pc-linux-gnu (actually the latest openSuse 11.1)
> Thanks in advance,
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-devel