"Syncronize Dirs" on local folder and remote (FTP)
Moderators: Hacker, petermad, Stefan2, white
"Syncronize Dirs" on local folder and remote (FTP)
I have tried to syncronize local and remote folder when option "by content" is checked. And files have different size are marked as "?" on diff listing.
If "by content" checkbox is clear all right ( not eq ).
TC 7.50a has not the same behavior
If "by content" checkbox is clear all right ( not eq ).
TC 7.50a has not the same behavior
- ghisler(Author)
- Site Admin
- Posts: 50512
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Can you send me a connection log, please?
TC 7.50 didn't support compare by content over ftp at all. TC 7.55 now supports it if the plugin announces (via reply to the FEAT command) that it supports one of these commands:
HASH
XCRC
XMD5
XSHA
MD5
TC then calculates the checksum of the local file, and compares it with the checksum reported by the server.
I guess that your server reports something like this, but then doesn't handle the command when TC tries to get the file checksum.
TC 7.50 didn't support compare by content over ftp at all. TC 7.55 now supports it if the plugin announces (via reply to the FEAT command) that it supports one of these commands:
HASH
XCRC
XMD5
XSHA
MD5
TC then calculates the checksum of the local file, and compares it with the checksum reported by the server.
I guess that your server reports something like this, but then doesn't handle the command when TC tries to get the file checksum.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Sorry, but this "FTP" is by plugin SFTP4TC ( it is not real FTP, over SSH ), witch based on PuTTY (older sync algorithm was same FTP).
I think the plugin hasn't these commands.
However now diff reports empty information about files with same names: if files are identical diff results => "?", files knowingly are not identical (different sizes) diff results => "?".
Maybe leave old algorithm on sync with FSplugins? md5 hashes are different on files have different size.
By log it uses "ls [remote dir]".
I think the plugin hasn't these commands.
However now diff reports empty information about files with same names: if files are identical diff results => "?", files knowingly are not identical (different sizes) diff results => "?".
Maybe leave old algorithm on sync with FSplugins? md5 hashes are different on files have different size.
By log it uses "ls [remote dir]".
- ghisler(Author)
- Site Admin
- Posts: 50512
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I see - indeed TC now shows "?" on plugins when the contents cannot be compared. I will consider to change that. Just uncheck the "content" option to avoid it.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Total Commander 7.55 Bug or incompatibility problem report.
Good day.
Topic is concern Folder synchronization of local folder with remote FTP folder via XCRC command. I found, that if CRC32 of file is like 0C54282F (starting from zero), it can make false file difference (with question mark) with some ftp servers like SERV-U, which removes leading zeros from CRC sums (here is FTP log):
Please, check others crc algorithms (MD5 and SH1) on this problem too. I have no possibility to check it by myself, my server supports only XCRC command.
Thanks you.
Topic is concern Folder synchronization of local folder with remote FTP folder via XCRC command. I found, that if CRC32 of file is like 0C54282F (starting from zero), it can make false file difference (with question mark) with some ftp servers like SERV-U, which removes leading zeros from CRC sums (here is FTP log):
Code: Select all
xcrc bak.7z
250 C54282F
Please, check others crc algorithms (MD5 and SH1) on this problem too. I have no possibility to check it by myself, my server supports only XCRC command.
Thanks you.
Usually I read from such strings by sscanf() function (or by my own polymorph function xscanf(), which can read from anywhere). And I see no problem to read both strings "250 C54282F" and "250 0C54282F" by this code:
More over, it is easy to create multi-pattern read:
Code: Select all
const char* test_string="250 C54282F";
// or
// const char* test_string="250 0C54282F";
int res = sscanf(test_string,"%d %lx", &srv_ans, &crc);.
Code: Select all
#include <stdio.h>
int main (void)
{
const char*pt []=
{
"%d %lx",
"%d %08lx",
"%d 0x%lx",
"%d $%lx",
0
};
// const char* test_string="250 C54282F";
// const char* test_string="250 0C54282F";
// const char* test_string="250 0xC54282F";
const char* test_string="250 $C54282F";
int srv_ans =0;
unsigned long int crc=0;
for (unsigned int i=0; pt[i];i++)
{
int res = sscanf(test_string,pt[i], &srv_ans, &crc);
if (res==2) break; else srv_ans=0;
}
if (srv_ans)
printf("Server ansver is %d, CRC is %08lX\n",srv_ans,crc);
else puts ("Error");
return(0);
}
- ghisler(Author)
- Site Admin
- Posts: 50512
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Currently TC uses the length of the returned string as one indication that the returned checksum is valid. If the length is bad, the question mark will remain, meaning "couldn't compare". I will try to support this special case, although it's very unusual.
Btw, does anyone know a sample file which gives a CRC32 of zero?
Btw, does anyone know a sample file which gives a CRC32 of zero?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Not exactly zero, but with leading zeros:
Code: Select all
MIME-Version: 1.0
Content-Type: application/octet-stream; name="files.7z"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="files.7z"
N3q8ryccAAOa+7yJZQAAAAAAAAAgAAAAAAAAAP/w/XABABQwMDE1IA0KMDA1OCANCjUyMDMgDQoA
AACBMweuD8+SbmAP6+qcvwza+cR0Rnl1jAAwAaESpt9r85rlt3ZV+zm6d3Y+pfDaVEwKoXhyebRU
ZmJxOWCyQ4AgqK9y/zVtiH/AABcGGQEJTAAHCwEAASMDAQEFXQAQAAAMZwoBbQrAiAAA
File with 0x0000 CRC32
ghisler(Author)
Here is file with zero CRC32 sum:
By the way. Why if I try to decode this file with TC it display warning message about illegal characters in source file (Mime)?
Here is file with zero CRC32 sum:
Code: Select all
MIME-Version: 1.0
Content-Type: application/octet-stream; name="data.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="data.zip"
UEsDBAoAAgAAAJGT1zwAAAAABAAAAAQAAAAIAAAAZGF0YS5kYXSdCtltUEsBAhQACgACAAAAkZPX
PAAAAAAEAAAABAAAAAgAAAAAAAAAAAAgAAAAAAAAAGRhdGEuZGF0UEsFBgAAAAABAAEANgAAACoA
AAAAAA==
Another SERV-U Ftp server log for this kind of file:
Code: Select all
xcrc data.dat
250 0
- ghisler(Author)
- Site Admin
- Posts: 50512
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Thanks very much! It's good to know that it returns a zero and not an empty string, that's what I needed to know!
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com