[Rd] two-way communication using Unix pipes

From: Jonathan Callahan <jonathan.s.callahan_at_gmail.com>
Date: Wed 16 Nov 2005 - 15:15:00 GMT


I am trying to communicate with R from a perl program. Because this code must be deployed on systems that are outside of my control I do not wish to pursue the RSperl.pm approach which requires that R be compiled to use shared libraries.

I have a custom, light weight module I have used with other command line driven programs like Ferret and Grads. This module follows the standard perl procedures for forking a process, opening pipes and then redirecting STDOUT, STDIN and STDERR. Commands are sent out to the external program and my perl module then uses perl's select(2) function to listen for output from the program.

Unfortunately, it doesn't ever seem to get a response from R on the redirected STDOUT or STDERR.

Looking at the perl IPC::Run module I see that some programs are aware of whether they are talking to a tty or not and revert to 'batch behavior' if they don't detect a tty.

Can someone please explain to me exactly what R is doing with the the standard IO handles and whether or not there is any simple way to convince it to behave as if it were talking to a user at the other end of a keyboard and terminal? I've already tried '--no-readline' but that doesn't solve my problem.

Many thanks in advance for any suggestions.

        [[alternative HTML version deleted]]

R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Nov 17 02:19:57 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:33 GMT