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

Advertisement

glavian
Joined:
Posts:
2

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

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:

            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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: Synchronize Directories always uploads all files with .NET Using Timestamp mode.

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.

Reply with quote

glavian
Joined:
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)

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
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 | */.

Reply with quote

Advertisement

You can post new topics in this forum