Hello,
 
I hope someone can help me with what seems like a simple problem.  I have the following code:
 
system("swat_edit.exe", wait=FALSE, invisible=FALSE)
system("swat2005.exe")
 
In the first line, swat_edit.exe edits hundreds of input files, which are then to be used by swat2005.exe in its calculations.  The problem is that before swat_edit.exe finishes editing and closing all the input files, swat2005.exe begins, and an error occurs that such-and-such an input file is already in use so that swat2005.exe cannot run.
 
Naturally, one would think that changing wait=FALSE ot wait=TRUE might solve the problem.  But wait = TRUE gives an error.
 
I am using Windows 7 and Windows XP, and this problem occurs with both.  I've inserted a time-delaying statement, z<- mean(runif(30000000,0,1), to buy time, but this only helps on the older computer I have, not on the new Core i7, which I really want to make use of.  The suggestion has been made to switch to a Linux system, but I'm having trouble getting the source code for swat_edit.exe so that I can recompile for Linux.  Any ideas, if I want to try to achieve this in Windows?
 
Your help would be much appreciated.
 
John Joseph
 
 

	[[alternative HTML version deleted]]

