There is a build machine in the network where it will automatically download the code from source repository and compile using visual studio and compresses the complete code in a zip file.

I have added a line at the end of the build script(written in python on that machine) to copy that zip file to my ESX Virtual machine.

Where I kept a AutoIT exe to wait for the zip file, once it is copied then I will extract the contents and find only the dll files in the extracted folder and do the Install creation using Installshield silently and copy the created setup files to anther machine.

I wrote the script till the setup files creation.

 

But now the problem is, when the zip file is copying through network, the autoit script is detecting it even the copy is still in progress and trying to extract the zip file and failing.

Even when I am checking whether the file in use is not working.

 

Any suggestion on how to check whether the copy is completed.?

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

1
Try doing a doing file size check every minute until the size is static.  once static, proceed.

Or if really want to ensure the file is correct, you could CRC the source then compare the file after the file size becomes static. I recommend CRC as that will be faster than MD5 or SHA1, i think the later would be a bit over kill.
Answered 11/20/2016 by: rileyz
Red Belt

  • Looks bit complicated. :)
    Present, I am copying one more empty text file after I copied this file as a confirmation of copy complete.
Please log in to comment

Answers

0
You could also add a timer.   Once the file is detected, wait ten minutes before running the next command.
Answered 11/21/2016 by: vjaneczko
Eighth Degree Black Belt

  • But the copy time may vary based on network right.
Please log in to comment
Answer this question or Comment on this question for clarity