2
FtpCompareResult compareResult = await ftp.CompareFileAsync(@"C:\test\Text.txt", @"/Text.txt");

Why does it output this? I would like to see Equals or NotEquals

VillyFiki
  • 129
  • 5
  • 1
    [`FtpClient.CompareFile()`](https://github.com/robinrodricks/FluentFTP/blob/master/FluentFTP/Client/FtpClient_FileCompare.cs#L28) has the option to compare file size and/or last modified date and/or checksum. That error is returned when the FTP server doesn't support checksums, and you have ask to compare using them. See [`FtpClient.SupportsChecksum()`](https://github.com/robinrodricks/FluentFTP/blob/master/FluentFTP/Client/FtpClient_FileVerification.cs#L18). – dbc Jun 06 '20 at 16:54
  • There doesn't seem to be an [option](https://github.com/robinrodricks/FluentFTP/blob/master/FluentFTP/Enums/FtpCompareOption.cs) to actually diff the files. – dbc Jun 06 '20 at 16:54
  • (If you are asking how to configure your server to enable checksums, that would be a separate question, possibly for https://superuser.com/ or https://serverfault.com/. A [mcve] would be needed also, probably, explaining what server you are using and how you set it up.) – dbc Jun 06 '20 at 16:55

1 Answers1

3

According to the source code of the method ChecksumNotSupported is returned if your FTP server does not support the following algorithms:

private bool SupportsChecksum() {
    return HasFeature(FtpCapability.HASH) || HasFeature(FtpCapability.MD5) ||
            HasFeature(FtpCapability.XMD5) || HasFeature(FtpCapability.XCRC) ||
            HasFeature(FtpCapability.XSHA1) || HasFeature(FtpCapability.XSHA256) ||
            HasFeature(FtpCapability.XSHA512);
}

or if the result of GetChecksum was invalid.

So you should configure the server properly.

smolchanovsky
  • 1,775
  • 2
  • 15
  • 29