R_Interactive {was '[Rd] stdout == 'Terminal' or 'File'}
Simon Urbanek
Simon.Urbanek at math.uni-augsburg.de
Wed May 12 11:47:49 CEST 2004
while the topic is on, something remotely related although the same:
On May 12, 2004, at 10:04 AM, Prof Brian Ripley wrote:
> interactive() is as good a test as we have, and I think if a better
> test
> is required in the interactive case, the user should be asked.
There may be a little problem in the current sources (talking unix for
now) - R sets the interactive flag like this:
system.c at 248: R_Interactive = isatty(0);
Unfortunately right after this there comes:
if (!R_Interactive && SaveAction != SA_SAVE && SaveAction != SA_NOSAVE)
R_Suicide("you must specify `--save', `--no-save' or `--vanilla'");
Now speaking of embedded R - the above leaves (afaik) no way of telling
R to use interactive mode before this suicide attempt if stdout is no
tty (it doesn't have to if the embedding app provides its own
Read/WriteConsole etc.). Any thoughts on this? (btw: aqua uses a hack
to circumvent this... whenever aqua needs a hack it may be worth
thinking about something more general ;))
Cheers,
Simon
---
Simon Urbanek
Department of computer oriented statistics and data analysis
University of Augsburg
Universitätsstr. 14
86135 Augsburg
Germany
Tel: +49-821-598-2236
Fax: +49-821-598-2200
Simon.Urbanek at Math.Uni-Augsburg.de
http://simon.urbanek.info
More information about the R-devel
mailing list