Why foo.txt precedes foo.bar.txt with sorting by names?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Why foo.txt precedes foo.bar.txt with sorting by names?

Post by *MVV »

I've just noticed that and found interesting. It looks nice (especially with aligned extensions) but I can't explain why it is so.

When sorting by names ascending, I see following files order (it is so for all four sort methods):

Code: Select all

foo.txt
foo.0.txt
foo.bar.txt
However '0' should precede 't' and 'b' in both aplhabetical and numeric character code sorting.

Who can explain this?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50918
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC separates the name into the actual name part, and the extension. When you sort by name, TC sorts by
foo
foo.0
foo.bar

It only sorts by extension when there are two files with the same name part.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

That makes it clear, thank you. When TC sorts by name, it sorts by just name w/o extension...
Post Reply