sftp sync dirs fails to detect file diff if ignore date on
Moderators: Hacker, petermad, Stefan2, white
-
- Junior Member
- Posts: 11
- Joined: 2011-11-10, 02:34 UTC
sftp sync dirs fails to detect file diff if ignore date on
put the two files below using the same name in separate dirs of the local hard drive; synchronize dirs is able to detect their difference, regardless of ignore date option.
using the sftp plugin, upload one of the files to a server; now the synchronize dirs fails to detect their difference if the ignore date option is on.
notice that the two files have different size, so totalcmd should be able to tell they are different.
-------- save this as dir1/structinit.m:
function out = structinit (in, val)
if (nargin < 2), val = []; end
out = structfun(@(f) val, in, 'UniformOutput',false);
end
-------- save this as dir2/structinit.m:
function out = structinit (in, val)
if (nargin < 2), val = []; end
out = structfun(@(f) val, 'UniformOutput',false);
end
using the sftp plugin, upload one of the files to a server; now the synchronize dirs fails to detect their difference if the ignore date option is on.
notice that the two files have different size, so totalcmd should be able to tell they are different.
-------- save this as dir1/structinit.m:
function out = structinit (in, val)
if (nargin < 2), val = []; end
out = structfun(@(f) val, in, 'UniformOutput',false);
end
-------- save this as dir2/structinit.m:
function out = structinit (in, val)
if (nargin < 2), val = []; end
out = structfun(@(f) val, 'UniformOutput',false);
end
-
- Junior Member
- Posts: 11
- Joined: 2011-11-10, 02:34 UTC
-
- Junior Member
- Posts: 11
- Joined: 2011-11-10, 02:34 UTC
When I try with your files (SFTP is in right panel; 1 = left file is older, 2 = left file is newer):
The only difference I see is when both by content and ignore date are selected. Is it what you mean? It's partly understandable, because TC is not downloading whole files to really compare them by content. But when they clearly differ in size, I think they should be marked as different, i.e. != instead of ?.
Code: Select all
Asym. By cont. Ign.Date SFTP1 SFTP2 Local1 Local2
OFF OFF OFF <- -> <- ->
OFF OFF ON != != != !=
OFF ON OFF <- -> <- ->
OFF ON ON ? ? != !=
ON OFF OFF -> ->
ON OFF ON != != != !=
ON ON OFF -> ->
ON ON ON ? ? != !=
Hi, folks.
This thread reads much as if it is about the same question / issue / problem as this thread: sftp plugin - synchronize dirs not working.
Cheers,
Karl
This thread reads much as if it is about the same question / issue / problem as this thread: sftp plugin - synchronize dirs not working.
Cheers,
Karl
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
What does the sync tool show, a question mark [?] or equal sign "="?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
-
- Junior Member
- Posts: 11
- Joined: 2011-11-10, 02:34 UTC
TC shows an equal sign with a "TXT" label on top of it. And it recognizes that the file size on the LHS is 139 bytes and on the RHS is 135 bytes. My point is that the difference in file sizes should be sufficient for TC to recognize the files as different.
Now, this is interesting: the file size difference is exactly four bytes, which is also the number of lines in the files. Could it be that TC is assuming the difference is being caused by the newline breaker -- LF in unix, CR+LF in Windows -- thus ignoring it?
In the sample files I gave, that assumption would be unwarranted, because there is a genuine file content difference unrelated to newline breakers.
Now, this is interesting: the file size difference is exactly four bytes, which is also the number of lines in the files. Could it be that TC is assuming the difference is being caused by the newline breaker -- LF in unix, CR+LF in Windows -- thus ignoring it?
In the sample files I gave, that assumption would be unwarranted, because there is a genuine file content difference unrelated to newline breakers.
It's actually a feature, check the following thread:
Synchronisation over FTP misses changed files in text mode
Synchronisation over FTP misses changed files in text mode
-
- Junior Member
- Posts: 11
- Joined: 2011-11-10, 02:34 UTC
-
- Junior Member
- Posts: 11
- Joined: 2011-11-10, 02:34 UTC
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
You get a '?' because compare by content isn't supported yet for file system plugins. This will be in the next version. I have already implemented it for sftp! It will call md5sum, sha1sum, sha256sum or sha512sum directly on the server, depending on what the server supports. At the same time, TC will calculate the corresponding checksum for the local file, and then compare the two.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com