sftp sync dirs fails to detect file diff if ignore date on

Please report only one bug per message!

Moderators: Stefan2, white, sheep, Hacker

Post Reply
fgnievinski
Junior Member
Junior Member
Posts: 10
Joined: 2011-11-10, 02:34 UTC

sftp sync dirs fails to detect file diff if ignore date on

Post by *fgnievinski » 2011-11-10, 02:46 UTC

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

fgnievinski
Junior Member
Junior Member
Posts: 10
Joined: 2011-11-10, 02:34 UTC

Post by *fgnievinski » 2011-11-10, 03:18 UTC

More info: the above refers to the native SFTP plugin available at ghisler dot com; using the one available from berlios dot de works with no problem.

fgnievinski
Junior Member
Junior Member
Posts: 10
Joined: 2011-11-10, 02:34 UTC

Post by *fgnievinski » 2011-11-10, 03:56 UTC

I'm sorry, I take that back: it fails with both sftp plugins -- would that indicate it's not a problem specific to any plugin, rather having origin in tc itself?
Thanks.

Sob
Power Member
Power Member
Posts: 908
Joined: 2005-01-19, 17:33 UTC

Post by *Sob » 2011-11-10, 08:46 UTC

When I try with your files (SFTP is in right panel; 1 = left file is older, 2 = left file is newer):

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       ?     ?      !=    !=
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 ?.

User avatar
karlchen
Power Member
Power Member
Posts: 4531
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen » 2011-11-10, 11:52 UTC

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

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36226
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2011-11-10, 15:35 UTC

What does the sync tool show, a question mark [?] or equal sign "="?
Author of Total Commander
http://www.ghisler.com

fgnievinski
Junior Member
Junior Member
Posts: 10
Joined: 2011-11-10, 02:34 UTC

Post by *fgnievinski » 2011-11-10, 18:11 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.

Sob
Power Member
Power Member
Posts: 908
Joined: 2005-01-19, 17:33 UTC

Post by *Sob » 2011-11-10, 22:11 UTC

It's actually a feature, check the following thread:

Synchronisation over FTP misses changed files in text mode

fgnievinski
Junior Member
Junior Member
Posts: 10
Joined: 2011-11-10, 02:34 UTC

Post by *fgnievinski » 2011-11-10, 23:23 UTC

OK, I'll file a feature request elsewhere.

fgnievinski
Junior Member
Junior Member
Posts: 10
Joined: 2011-11-10, 02:34 UTC

Post by *fgnievinski » 2011-11-10, 23:23 UTC

The icon with TXT on top of an equal sign is hard to spot when the majority of files are equal.

User avatar
Lefteous
Power Member
Power Member
Posts: 9429
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous » 2017-05-11, 13:28 UTC

I know it's an old thread but all I get just is '?' as result with 'compare by content' and 'ignore dates' checked. I'm using TC 9.0a and sftp 1.42. When I compare those files the resulting msgbox says files are identical.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36226
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2017-05-15, 13:45 UTC

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
http://www.ghisler.com

Post Reply