SynchronizationCriteria.Either Not Working As Expected
I have a daily scheduled process which downloads newer files from an FTP site. I recently ran into a problem whereby the FTP site had not been updated with new files. However, the process is still downloading the equal files even though I am using SynchronizationCriteria.Either for the synchronization. The WinSCP log reports the files as having the same time and the same size but the files are still selected as being "new".
Here is an excerpt of some relevant log entries. You can see the files have the same time and size.
Here is the relevant portion of code used for the transfer:
Here is an excerpt of some relevant log entries. You can see the files have the same time and size.
. 2013-07-08 05:00:21.217 type=file;modify=20130702070747;size=9078; AGC_Procedures.zip.gpg . 2013-07-08 05:00:21.220 Remote file '/SSIS_Extract/AGC_Procedures.zip.gpg' [2013-07-02T07:07:47.000Z] [9078] is new
using (Session session = new Session()) { if (SessionLogPath != null) { session.SessionLogPath = SessionLogPath; } // Will continuously report progress of synchronization session.FileTransferred += FileTransferred; // Connect session.Open(sessionOptions); SynchronizationResult synchronizationResult; synchronizationResult = session.SynchronizeDirectories( SynchronizationMode.Local, LocalDir, RemoteDir, false,false,SynchronizationCriteria.Either); // Throw on any error synchronizationResult.Check(); }