Hi,
I'm using Ftp::GetFile() to download files off a remote FTP server. In most cases everything works fine.
However, if the file I'm downloading is currently in the process of being uploaded by another program (FileZilla in my case) then I get an exception thrown by Ftp::GetFile() telling me that the file can't be opened. This in itself isn't a problem as I can handle the exception and simply try again later.
But.....
It manages to kill the FileZilla upload and results in a corrupted/incomplete file ending up on the server.
Now I accept that this is really a problem with FileZilla, but bearing in mind how many people use it, is there a more defensive way that I can code to avoid this problem?
For example, I tried to find a way of establishing if the file in question was currently open - without much success.
Does anyone out there know of a reliable way of deciding when it's safe to call Ftp::GetFile()?