Topic "Synchronize Directories always uploads all files with .NET Using Timestamp mode."

Author Message
glavian
[View user's profile]

Joined: 2016-04-21
Posts: 2
Hi,
I'm using the .NET Library and anytime I call SynchronizeDirectories using TimeStampMode it synchronizes the whole directory. I'm only doing remote synchronization. If I use the WINSCP client I do not experience this issue so I'm not sure if I'm missing some setting with .NET or there is a bug. I am using CoreFTP as my server. I also did a test where I grab the fileinfo myself using the .NET and it appears to return the same LastWriteTime stamp as my local file.


This is the code I'm using to do the sync:

Code:
            TransferOptions transferOptions = new TransferOptions();
               transferOptions.TransferMode = TransferMode.Binary;
               transferOptions.FileMask = WinSCPUtil.CreateFilterMask(m_mapping);

               var syncResult = session.SynchronizeDirectories(SynchronizationMode.Remote, m_mapping.SourcePath, m_mapping.DestPath, false, false, SynchronizationCriteria.Time, transferOptions);

               syncResult.Check();


Any help would be appreciated. I'd prefer to use SynchronizeDirectories over writing my own function that does this.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
Please attach a full session log file showing the problem, both for GUI and the .NET assembly.

To generate log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
glavian
[View user's profile]

Joined: 2016-04-21
Posts: 2
I have attached the log file. The test case I did was as follows.

1) I cleaned out my coreFTP server directory.
2) Ran File Synchronization. All expected files were updated.
3) Added a new file into the directory.
4) All files were again updated even though "time" is my sync mode.

Based on what I can tell it looks like the "Ms" value on the file time-stamps aren't being retrieved when listing the remote directory.
WinSCP.log (41.76 KB) Private file

Description: (none)

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
It's the filemask that breaks it. Using an absolute include mask in synchronization just does not work, because it effectively treats all files on the opposite side as non-existing. What did you try to achieve by the D:\bin\*.* mask? Did you want to exclude subfolders? For that use | */.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License