Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Woojo01

Re: SynchronizationCriteria.Either Not Working As Expected

martin wrote:

You can tell that from result of Session.SynchronizeDirectories.
See https://winscp.net/eng/docs/library_synchronizationresult

Perfect! I looked at it in VS2012 Object Explorer and it has exactly what I need.
Thanks again!

--
JW
martin

Re: SynchronizationCriteria.Either Not Working As Expected

Woojo01 wrote:

Now for another question: Is there a result or way to determine, using the .NET assembly, if any files were synched and possibly how many? It would be good to know, from a result, whether or not any files were actually downloaded.

You can tell that from result of Session.SynchronizeDirectories.
See https://winscp.net/eng/docs/library_synchronizationresult
Woojo01

Re: SynchronizationCriteria.Either Not Working As Expected

martin wrote:

Please attach a complete session log file showing the problem. Ideally on a small set of files (even just one).

Thank you for your very quick response!

My bad.... the local files were being deleted just prior to the synch. After making sure the local files are not deleted, the log was different in that it now showed files marked as local and the log also included a line with "Nothing to synchronize". The function IS working as expected.

Now for another question: Is there a result or way to determine, using the .NET assembly, if any files were synched and possibly how many? It would be good to know, from a result, whether or not any files were actually downloaded.

Thanks for a great product and excellent support!
--
JW
martin

Re: SynchronizationCriteria.Either Not Working As Expected

Please attach a complete session log file showing the problem. Ideally on a small set of files (even just one).
Woojo01

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.
. 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

Here is the relevant portion of code used for the transfer:
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();
}