| Colleagues,
I am facing an unusual situation for which I need some help.
I am running S-Plus (8.0.4; Windows) from within a GUI (RealBasic). I send a command to the OS to run a program. Ideally, I would like to put this process in the background. Two functions in S-Plus, dos and system have a "multi" option, which when set to T places a job in the background and returns control to S-Plus.
The problem that I encounter regards the output from my system process. Scenarios are: system(multi = T, ...) : I receive messages from the OS saying "The process cannot access the file because it is being used by another process". system(multi = F, ...): same dos(multi=T, ...): same
dos(multi=F, output.to.S=F, ...): same dos(multi=F, output.to.S=T, ...): no problem
It appears that not sending the output to S (which is the default for "system") is responsible for this system-level problem occurring.
I believe that a solution would be to write a function similar to "dos" that has the following characteristics: 1. it allows "multi" = T (i.e., it allows backgrounding of the process) 2. it sends the output from the system process to some benign location (? NUL, however, best to allow the user to control that destination for testing purposes)
Unfortunately, despite looking at the internal code for dos, system, and shell (and the corresponding functions in R), I cannot figure out how to write such a function. However, I expect that someone on the list understands enough of the issues to help. Any help would be greatly appreciated.
Thanks for your consideration.
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 |