Thanks, Melwin.  You've helped me to finally overcome a problem that I've struggled with for months!  I'm not
sure that my question belonged on this list, but I had been trying for so long without any luck.  I appreciate your
help.
John Joseph

________________________________

From: Melwin [mailto:win@comets.de]
Sent: Tue 6/8/2010 7:06 AM
To: r-sig-hpc@r-project.org; John Joseph
Subject: Re: [R-sig-hpc] file closing timing problem



I am not sure if this belongs on this list, anyway:

Wait until somefile.dat (i.e. a file that is supposed to be modified by 
swat_edit.exe) has been renewed:

while ( difftime(Sys.time(),file.info("somefile.dat")$atime,units="sec") > 
30 )
        Sys.sleep(1)
#to be placed between your two system calls

cheers,

Melwin

Am 08.06.2010, 13:38 Uhr, schrieb John Joseph <John.Joseph@utsa.edu>:

> 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]]
>
> _______________________________________________
> R-sig-hpc mailing list
> R-sig-hpc@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-hpc


--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/




	[[alternative HTML version deleted]]

