/build/static/layout/Breadcrumb_cap_w.png

How to check whether a file copied completely?

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

Answers (2)

Posted by: rileyz 7 years ago
Red Belt
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.

Comments:
  • Looks bit complicated. :)
    Present, I am copying one more empty text file after I copied this file as a confirmation of copy complete. - ur00361883 7 years ago
Posted by: vjaneczko 7 years ago
9th Degree Black Belt
0
You could also add a timer.   Once the file is detected, wait ten minutes before running the next command.

Comments:
  • But the copy time may vary based on network right. - ur00361883 7 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ