Skip to content

bugs in system() handling long character strings??

2 messages · ntakebay@bio.indiana.edu, Brian Ripley

#
Hi,

system(cmd, intern=T) seems to have a problem when cmd returns a long
character string.

For example, if a file (/tmp/long.txt) contains a long string such as:

123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890

There are 120 characters in this one line.
[1] "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"
[2] "0"
[1] 118

So one long line get separated into two parts, and additionally 119-th
character is missing.

Is this a bug in R or am I missing something?

I tried this on R-1.6.1 on linux/alpha and linux/i386.

Thanks,
Naoki

Naoki Takebayashi     <ntakebay at bio.indiana.edu>
--- Dept. of Biology, Box 90338, Duke University, Durham, NC 27708-0338
#
There is an undocumented limit of 119 characters/line when using
system(intern=TRUE) on Unix.  You can easily raise it: it is in
do_system in file src/unix/sys-unix.c.

I think this limit should be raised considerably, but it may well not be
worth eliminating it.
On Sat, 7 Dec 2002, Naoki Takebayashi wrote: