From p.dalgaard at biostat.ku.dk  Tue Mar 11 09:29:48 2003
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard BSA)
Date: Tue Mar 11 09:28:34 2003
Subject: [Rd] system(..., intern=TRUE) splits long lines (PR#2623)
In-Reply-To: <200303101859.h2AIxQn9026306@pubhealth.ku.dk>
References: <200303101859.h2AIxQn9026306@pubhealth.ku.dk>
Message-ID: <x23clugvb7.fsf@biostat.ku.dk>

vograno@arbitrade.com writes:

> system(..., intern=TRUE) splits long lines after 118th character and
> discards the 119th character 
> 
> > a <- paste(rep("a", 124), collapse="")
> > system(paste("echo", a), intern=TRUE)
> system(paste("echo", a), intern=TRUE)
> [1]
> "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaa"
> 
> > 
> 
> The result is a vector of length 2 and it should be that of 1.

> major    1                
> minor    6.0              

Not so in 1.6.2:

> a <- paste(rep("a", 124), collapse="")
> system(paste("echo", a), intern=TRUE)
[1]
> "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

You might at least have checked the NEWS file for 1.6.2:

    o   system(intern=TRUE) has an undocumented line length limit of
        119 chars both on Unix and Windows.  The limit is now 8096 and
        documented.  On Unix (only) every 120th character used to be
        discarded.



-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] system(..., intern=TRUE) splits long lines (PR#2623)
Peter Dalgaard BSA