Re: [R] system(..., invisible=FALSE, show.output.on.console=FALSE) in Windows 7

From: Duncan Murdoch <murdoch.duncan_at_gmail.com>
Date: Wed, 09 Mar 2011 15:55:33 -0500

On 09/03/2011 2:34 PM, jim holtman wrote:
> I see something similar on my system. Running your command line, I
> can see the command window flashup and then disappear.

We have had issues in the past with setting the input file handle for external commands to an empty stream. Then cmd reads from the stream, immediately hits EOF, and quits.

It should do this consistently, so the fact that some people are seeing inconsistent behaviour looks like a bug to me. But whether it is a bug in R or a bug in Windows is hard to determine.

I'm not going to work on this in the near term (I keep getting friendly reminders of other problems I've promised to work on), but if anyone else feels like debugging it, I would suggest looking at how the file handles are handled.

Duncan Murdoch

> > sessionInfo()
> R version 2.12.1 (2010-12-16)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United
> States.1252
> [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
> [5] LC_TIME=English_United States.1252
>
> attached base packages:
> [1] tcltk stats grDevices utils datasets graphics
> methods base
>
> other attached packages:
> [1] RColorBrewer_1.0-2 sqldf_0.3-5 chron_2.3-39
> gsubfn_0.5-5
> [5] proto_0.3-8 RSQLite.extfuns_0.0.1 RSQLite_0.9-4
> DBI_0.2-5
> [9] zoo_1.6-4 plyr_1.4
>
> loaded via a namespace (and not attached):
> [1] grid_2.12.1 lattice_0.19-17 tools_2.12.1
> >
>
>
> On Wed, Mar 9, 2011 at 12:14 PM, Ralph Olsson
> <ralpholsson_at_btinternet.com> wrote:
> > Hello,
> >
> > I work for a company in which a number of employees use R. Many of them like to run executables via the system function in such a way that the output of that executable is displayed in a separate window. To give an example of the behavior they require, the following command can be run in R GUI:
> >
> > system("cmd",invisible=FALSE,show.output.on.console=FALSE)
> >
> > The result is that a command prompt opens up and can be used interactively until it is closed. We have never had a problem with this command running R on Windows XP machines.
> >
> > Recently a number of us have switched to PCs running Windows 7. Under this operating system the above command often, if not always, fails to open a window. Some people can successfully run the command in one R session but then fail to get a window if a second R session is started. Others cannot get a window to open at all. We've tested the command with R 2.12.1, 2.12.1 patched, 2.12.2 and 2.12.2 patched (all in both 32 and 64 bit). All of these exhibit the same problem.
> >
> > I raised the issue as a bug (https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14516), but this was promptly closed as being "not reproducible". Since we are having issues running the above command on all of our windows 7 PCs but none of our windows XP PCs, and since whoever closed the bug clearly had no issues running the command on his or her Windows 7 PC, I'm not really sure what to do next in terms of trying to resolve the problem.
> >
> > Can anyone shed any light on this issue? Is anyone able to reproduce it (only takes 30 seconds, just copy the above line into RGui on Windows 7 and confirm whether a command prompt opens; then, with the first session still open, try the same in a second RGui window)?
> >
> > Any help or feedback would be appreciated,
> >
> > Cheers,
> >
> > Ralph
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help_at_r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
>
>



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 09 Mar 2011 - 20:58:18 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 11 Mar 2011 - 15:10:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive