Sorting by time - random order under some circumstances

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
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Sorting by time - random order under some circumstances

Post by *MarcinW »

Tested with TC 9.20 RC3. The example below may look artificial, but it's just a simple way to reproduce a more complicated real-life behavior.


Steps to reproduce - do exactly(!) as described:

1) some NTFS partition is needed - let's assume it's c:

2) create folder c:\testA
3) create empty file file1.txt there
4) wait 2 seconds
5) create empty file file2.txt there
6) wait 2 seconds again
7) by using Files -> Change Attributes menu, set date and time of both files to the current date and time
This way, both files have their modification times different than their creation times.

8) create folder c:\testB
9) create empty file file1.txt there
10) wait 2 seconds
11) create empty file file2.txt there
12) by using Files -> Change Attributes menu, change date and time of file1.txt to the same values as file2.txt has
This way, one file has its modification time same as its creation time, and another file has its modification time different than its creation time.



Now go to c:\testA in left panel and to c:\testB in right panel.

In left panel:
- click three or four times on the SIZE column - sizes are same, so files are sorted just by name - they are not reordered when clicking.
- click three or four times on the DATE column - dates and times are same, so files are sorted just by name - they are not reordered when clicking.

In right panel:
- click three or four times on the SIZE column - sizes are same, so files are sorted just by name - they are not reordered when clicking.
- click three or four times on the DATE column - dates and times are same, but sorting order changes when clicking.



Same problem occurs also when sorting results in Find Files (Alt+F7) tool - and possibly also in other places.

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

Post by *ghisler(Author) »

This isn't a bug. In case 1, the two files really have the same date and time. In case 2, you set the date/time of file1.txt only with the displayed precision (1 second). However, file2.txt has a file time with NTFS precision, which is much higher. When sorting, the complete time is used, not just rounded to the nearest second.
Author of Total Commander
https://www.ghisler.com
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Hm. So, in fact, this isn't a bug.

Is there a way to see full time precision in TC?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No, at least not with built-in custom fields. It could be done with a content plugin, though.
Author of Total Commander
https://www.ghisler.com
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Well, so it's a bit strange. When sorting, TC uses some information, that can't be obtained by TC's user interface.

Maybe it would be a good idea to add lacking information (i.e. file time with full precision) to custom fields - in some future TC release.

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

Post by *ghisler(Author) »

Well, as far as I know, the Explorer does the same.
Author of Total Commander
https://www.ghisler.com
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Well, but TC is better than Explorer :wink:
Post Reply