CompareDirectories

Advertisement

tdilpme
Joined:
Posts:
1

CompareDirectories

Hi All,
I'm just trying to do a CompareDirectories like such:
var compareDirectoryResult = session.CompareDirectories(SynchronizationMode.Both,
    $@"{SettingsVM.CustomerInputDeckDirectory}\{folder.Name}",
    SettingsVM.ConcurrentRemoteFileLocation, false, false, SynchronizationCriteria.Either);
If there are differences, I list them and if there are not just let user know the directories are the same. (Like this)
if (compareDirectoryResult.Count > 0)
{
// I list the changes
}
else
{  
  // Let user know they are the same
}
The problem I encounter is that the files in the local and remote folders are all the same name, and size, but there will be a couple files with the "Last Modified" attribute different by a few minutes or so, but my result comes back as compareDirectoryResult.Count == to zero therefore not catching any changes. Am I doing something wrong in how I'm calling this method? Not sure how to make it accurate. Please help.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: CompareDirectories

Please attach a full session log file showing the problem (using the latest version of WinSCP). Name a file that you believe should have been identified as different, but was not.

To generate the session 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

Advertisement

You can post new topics in this forum