Compare files by date bug: 2-seconds difference ===0

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Isica
Junior Member
Junior Member
Posts: 38
Joined: 2013-09-24, 05:07 UTC

Compare files by date bug: 2-seconds difference ===0

Post by *Isica »

tc8.51a (x32) and older; FAT32 (may be NTFS too).
Two files with the difference in time =2 seconds, recognized as same!
Last edited by Isica on 2015-04-22, 07:11 UTC, edited 1 time in total.
HuSc
Junior Member
Junior Member
Posts: 25
Joined: 2014-03-10, 15:55 UTC

Post by *HuSc »

Hi,

this effect is a limitation of the FAT32 file system, which has a file timestamp granularity of 2 seconds.

NTFS has a much finer granularity.

Cf following thread, where I had noticed this effect too and had assumed a TC bug then:
http://www.ghisler.ch/board/viewtopic.php?t=41930

Hubert
Isica
Junior Member
Junior Member
Posts: 38
Joined: 2013-09-24, 05:07 UTC

Post by *Isica »

No!
I know about this limitation FAT.
File times really different (for example, 1:02:02 and 1:02:04), and it shows on the panels TC. But in comparison, they are "equal".
This is exactly the bug!
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Please imagine following situation: you copy file from FAT to NTFS (or vice versa) and then run sync. Your files may have such time difference because FAT rounds seconds, but I'm sure you'll want to see that files are the same.

BTW it is interesting how did you get files with 2-second difference which are really different and this difference is important.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, a timestamp difference of up to 2 seconds is ignored. This is by design for the above reasons.
Author of Total Commander
https://www.ghisler.com
Isica
Junior Member
Junior Member
Posts: 38
Joined: 2013-09-24, 05:07 UTC

Post by *Isica »

2ghisler(Author)
If "up to 2 seconds" (<), then it is understandable. But why ignore the difference exactly 2 seconds? Bug?

2MVV
Please imagine following situation: you copy file from FAT to NTFS (or vice versa) and then run sync. Your files may have such time difference because FAT rounds seconds, but I'm sure you'll want to see that files are the same.
NTFS provides file time with excessive precision. And if you adhere to a strict rounding algorithm, say, 00.0000--00.9999 seconds will always be equal to 0, and 01.0000--02.9999 equal to 2.
However, I did not study the behavior of the SetFileTime in different versions of the Windows :)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

But why ignore the difference exactly 2 seconds? Bug?
No, for example when you copy a file from NTFS to FAT32 with one program, pack to ZIP (also 2 seconds resolution) with some others and then unpack, you may get exactly 2 seconds difference. For example, one program may round up 1.99 seconds to 2, and other may just truncate to 0.
Author of Total Commander
https://www.ghisler.com
Post Reply