I just discovered WinSCP and I'm slowly figuring out the details of how it works. Here's my situation. I have a device that stores files in a folder, fairly continuously. (with pauses of 2–5 minutes between batches of 10–20 files). The storage space on that device is rather small, so I was trying to figure out a way to download & delete. I did come with some code that works quite well, with one exception. If the file being downloaded via WinSCP is still in the process of being written by the device, I only get a partial file (only what's available at the time of download) and then the original gets downloaded.
So since I can delete the partial file, it's most likely not r/o or locked in any way, so I can't relay on that. Files are always different sizes, so I can't rely on size to know when it's done saving.
The only way I can think of to prevent that issue is to go with the timestamp on the file, and process it only if it's older than say 5 minutes, but that seems like a rather inefficient way to handle this.
Anyone have any suggestions?