From erich.neuwirth@univie.ac.at  Fri Feb  9 13:20:08 2001
From: erich.neuwirth@univie.ac.at (Erich Neuwirth)
Date: Fri, 09 Feb 2001 14:20:08 +0100
Subject: [Rd] system command
Message-ID: <3A83EE88.67F639ED@univie.ac.at>

i am using
system
to call the external program csound.
csound does some output to stdout and some to stderr
system handles this differently on the different platforms.

on unix (i have solaris, but as far as i know it is the same on linux)
system("csound",intern=TRUE) redirects stdin into an R object, 
by still outputs stdout to the R window.
system("csound",intern=FALSE) (equivalent to system("csound"))
stdout and stderr go into the R window

Rterm
on win95
system("csound",intern=TRUE) redirects stdin and stderr into an R object
system("csound",intern=FALSE) (equivalent to system("csound"))
outputs everything

Rterm
on win2k
system("csound",intern=TRUE) redirects stdin and stderr into an R object
system("csound",intern=FALSE) (equivalent to system("csound"))
outputs everything
EXCEPT
once 
system("csound",intern=TRUE) has been done
and later one tries
system("csound",intern=FALSE)
stderr is lost completely.
going back to
system("csound",intern=TRUE)
redirects stderr again into the R object,
but stderr does not go to the screen any more
after intern=TRUE has been used once.


so we seem to have to problems:
1) different behavior of system on unix and win32k
2) problems with system and redirection on win32k.


--
Erich Neuwirth, Computer Supported Didactics Working Group
Visit our SunSITE at http://sunsite.univie.ac.at
Phone: +43-1-4277-38624 Fax: +43-1-4277-9386
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] system command
Erich Neuwirth