Dennis Fisher wrote:> Colleagues,
>
> I have encountered the following situation in R (2.9.0) with Windows XP.
>
> I have an application that calls Rterm.exe. In certain situations, the
> application terminates but fails to close R. Then, the next time that
> the application runs, there are replicated copies of R running - this
> slows the system. One solution would be to kill any open versions of
> Rterm.exe each time the application terminates. But, that would affect
> other legitimate copies of Rterm.
>
> The solution to that problem is simple. Instead of running Rterm.exe, I
> copy Rterm.exe to Rterm-nnnnn.exe, execute that version, then when the
> job is complete, I can specifically terminate that version using
> Window's taskkill command.
>
> Unfortunately, I just encountered a new problem. If the R folder has
> restricted privileges, it appears that I cannot copy Rterm.exe to the
> same folder. So, I attempted a work-around, i.e., move the copy to
> another folder (e.g., Desktop). However, this does not work - when the
> copy is in another location, it opens, then closes immediately.
>
> So, my question is: is there some means to call Rterm.exe (I assume that
> the same would apply to R.exe) from a folder other the bin?
It does not need to be called bin, but must be in the same level of the
directory structure within the main R folder.
I guess you could better record the PID of your R session (Sys.getpid(),
say in some file) and delete that file on graceful exit of R. Otherwise
you can kill the process with the old PID later on.
Uwe Ligges
> Dennis
>
>
> Dennis Fisher MD
> P < (The "P Less Than" Company)
> Phone: 1-866-PLessThan (1-866-753-7784)
> Fax: 1-415-564-2220
> www.PLessThan.com
>
> ______________________________________________
> 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.