<div>First off, I am just learning Python, so if there is a more efficient way to do this, then I am all ears....   (NOTE:  The code below is something that I was messing with to learn threads...  So some functionality is not applicable for your needs..I just wanted to show you a demonstration)    
</div>
<div>One way that you could get around this, is to use threads.   You can lock your thread and when the lock has been released, you could open it and ensure your copy has succeeded.  Just a thought....<br>~~~~~~~~~~~~~~~~~~~~~~~
</div>
<div>import thread<br>def counter(myId, count):<br> for i in range(count):<br>    stdoutmutex.acquire()<br>    #Copy Your File Here<br>    stdoutmutex.release()<br> exitmutexes[myId].acquire()</div>
<div>
<p> <br>stdoutmutex = thread.allocate_lock()<br>exitmutexes = []<br>for i in range(2):<br>   exitmutexes.append(thread.allocate_lock())<br>   thread.start_new(counter, (i, 2))<br> <br>for mutex in exitmutexes:<br>   while not 
mutex.locked(): <br>       #Open Your File Here</p>
<p>print 'Exiting'</p></div>
<div> </div>
<div><br> </div>
<div><span class="gmail_quote">On 1/30/07, <b class="gmail_sendername">Hugo Ferreira</b> <<a href="mailto:bytter@gmail.com">bytter@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi there,<br><br>I have a problem. I'm using calling shutil.copyfile() followed by<br>open(). The thing is that most of the times open() is called before
<br>the actual file is copied. I don't have this problem when doing a<br>step-by-step debug, since I give enough time for the OS to copy the<br>file, but at run-time, it throws an exception.<br><br>Is there anyway to force a sync copy of the file (make python wait for
<br>the completion)?<br><br>Thanks in advance!<br><br>Hugo Ferreira<br>--<br><a href="http://mail.python.org/mailman/listinfo/python-list">http://mail.python.org/mailman/listinfo/python-list</a><br></blockquote></div><br>