[R] Flushing the R output buffer.

Richard chergr at bigpond.com
Wed Oct 30 13:26:56 CET 2002


I am connecting R to a PHP web script.

The first effort attempted to use a named pipe
but gave up on that because PHP could not read
any data from the named pipe.

I changed to using a temp file but it also has problems.
It appears that the file to which R's output is redirected
is not recieving any output until the pipe connection form PHP
is closed. I think this means that R is buffering its output
and there appears to be no flush function.

I would like to use a sequence like:

open pipe to R and incommand redirect R outout to file/fifo

open file
send R command
read response from file
close file

open file
send R command
read response from file
close file
close pipe

I checked the archives and there a function
flush.console() was mentioned -- I looked for this in
the docs but could not find it. The function does not appear
to affect flushing of the R output to the file.

This is a RedHat Linsux 7.3 on x86 install

Has anyone any suggestions??

r-help 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-help-request at stat.math.ethz.ch

More information about the R-help mailing list