We have a FreeBSD server with samba, in which employees copy image files, which are then uploaded to our web servers (thus, they do not need to contact ftp). Sometimes, if a script is loaded at the same time as copying files, it may download an incomplete file.
We fixed this by getting a list of files along with file sizes, then waiting 5 seconds and double-checking file sizes. If the sizes match, then saving them for loading, if they do not match, is checked again after another 5 seconds.
This seems like a weird way to check if files are being written. Is there a better, easier way to do this?
source share