Re: [Rd] Revision of shell.exec?

From: Stephen Weston <stephen.b.weston_at_gmail.com>
Date: Wed, 14 Sep 2011 08:50:18 -0400

2011/9/14 Uwe Ligges <ligges_at_statistik.tu-dortmund.de>:
>
>
> On 14.09.2011 12:27, Brian Oney wrote:
>>
>> Hi List,
>> I hope this is correct list to propose function extensions, sorry if not.
>> I am preparing for a (hopefully painless) migration to linux. As far as
>> I am aware of, the function "shell.exec" only comes with the windows
>> version. I think this is a handy little function and would like to see
>> my scripts work when I migrate.
>>
>> May I propose something (like the following)?
>>
>> open.file <- function(file) {
>> if(.Platform$OS.type=="windows") {shell.exec(file)} else
>> {system(paste("open ",file))}
>> }
>>
>> Or just a small addition to the shell.exec function and no new named
>> function.
>> Hope the idea isn't received as "too stupid".
>
> What is "open" supposed to do on a non-Windows machine? I do not have it on
> the only Linux installation I looked at now, hence we obviously cannot
> assume it exists on an arbitrary installation.

I think the nearest equivalent for those running Gnome or KDE may be "xdg-open". So there would probably need to be a new option for specifying the appropriate command.

Personally, I am more inclined to use "system" for executing commands, and "browseURL" for opening documents. "browseURL" even uses "xdg-open" in my R installation on my Linux machine.

>
> Best,
> Uwe Ligges
>
>
>>
>> Cheers,
>> Brian
>>
>> ______________________________________________
>> R-devel_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 15 Sep 2011 - 11:34:08 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 Thu 15 Sep 2011 - 11:50:30 GMT.

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

list of date sections of archive