Python 2.6
My script needs to track some 1g files on FTP Ever changed / modified it, the script will download it to another location. The name of those files will remain unchanged, people will delete the original file on the first file, then upload a new version. My script file will check file size like metadata and it will be modified to see if there is any difference.
The question is, when the script is tested metadata, then the new file is still being uploaded. How to handle this situation? Does a file attribute indicate the uploading status (such as the file is locked)? Thank you.
There is no such feature that you may be unable to obtain such a file, but it is on the server software depends on. Additionally, while uploading the file the file can be set aside, and uploaded once it is uploaded; The name may be modified in an incomplete file (for example, original_filename.ext.part) - it all depends on the server-side software used to upload.
If you control the server, create your own metadata, e.g. When the upload finishes, create an empty flag file with the newly uploaded file.
In the general case, I'm afraid, the best you can do is consider uploading the monitor file size and file completely if its size is not changing for a while. Make the largest (on the order of minutes).
Comments
Post a Comment