I have a program that is looking in a specific folder for incoming zip files. These files are coming through a 56k pipe on our network so it usually takes approximately 1-2 minutes for the file to be completely copied from the remote location. I need a way to determine when the file is released(not in use/transfer complete) so I can then test to make sure it is a valid zip and then process accordingly. If the connection breaks and the file doesn't get transferred completely, I then test to determine whether it is a valid zip or not and process accordingly.
If I run the test before the file transfer completes, it just looks like it is a bad zip. The problem is that sometimes there are broken transmissions and there are actually bad zips out there. When I come across these files I move them to a "bad zip" folder.
Is there anything that writes to the file attribute or any sort of flag that signals when the file is released or the transfer is finished?