Sort by name part instead of fullname

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

zencoder
Junior Member
Junior Member
Posts: 9
Joined: 2008-10-12, 15:06 UTC

Sort by name part instead of fullname

Post by *zencoder »

With Configuration / Tabstops / Show file extension directly after filename, then sorting by Name, I see this (dirs between brackets):

[c.aa]
[c.aa.1]
[c.ab]
b.bb
b.bc
b.bb.1

I would expect the files to be sorted like this:

b.bb
b.bb.1
b.bc

I've seen the post no. 16010 but adding a custom column is not a solution (you cannot replace the Name column).

After adding a ".old" extension to files, I expect the files to be sorted as with dir /b, not artificially stripped off their extensions and then sorted. You probably want this when "Show file extension aligned (with Tab)" is set, but that's different.
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Post by *Clo »

2zencoder

:) Hello ! Welcome aboard !

• Maybe a look to Configuration >> Options >> Sort method [_______] could help ?

:mrgreen: Kind regards,
Claude
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
zencoder
Junior Member
Junior Member
Posts: 9
Joined: 2008-10-12, 15:06 UTC

Post by *zencoder »

Thank you, I checked that. The problem is that before sorting by name, TC apparently removes the extension:

b
b
b.bb

that's fine. But what I see is the filename WITH the extension:

b.bb
b.bc
b.bb.1

=> not ok. Depends how you see things, but if the extension is part of the filename, then the sorting is wrong.
User avatar
Hacker
Moderator
Moderator
Posts: 13067
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

zencoder,
The extension is not considered part of the filename.

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
zencoder
Junior Member
Junior Member
Posts: 9
Joined: 2008-10-12, 15:06 UTC

Post by *zencoder »

Yes, it is part of the filename:

Wikipedia:Filename
Wikipedia:Filename_extension#The_need_for_more

Check how names are sorted in Windows Explorer. Why should it be different in TC?
User avatar
Hacker
Moderator
Moderator
Posts: 13067
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

zencoder,
Yes, it is part of the filename
I see I should have been more clear, sorry. The extension is not considered part of the filename for sorting purposes in TC.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
zencoder
Junior Member
Junior Member
Posts: 9
Joined: 2008-10-12, 15:06 UTC

Post by *zencoder »

Precisely, I am wondering why TC doesn't consider the extension as part of the filename when it is displayed as the full name.

And why would TC show/sort files differently from what they are on the file system, and against the conventions?

Perhaps you could have two sorting modes, one for fullname (sort on the full name including the extension) - and one for name + extension (the way it works now).
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

TC is just doing his work, following the conventions !

A fully qualified filename on windows consists of this parts:
- Drive / devicename
- Path
- name
- extension

(at least for MS see Making Room for Long Filenames or even Filename-Parts Syntax )
Don't ask me why their explorer is not following their own statements ... ;)

No matter which display type I choose (extension aligned with name or in separate column) name remains name and extension remains extension.

If I want to sort by name, I click the Name column.
If I want to sort by extension, I click on the Ext column.
If I want to sort by full name , I click on full name (custom) column

It just works as designed ...

BTW: the Name and Ext column cannot be hidden, but size can be set to 5
#5767 Personal license
zencoder
Junior Member
Junior Member
Posts: 9
Joined: 2008-10-12, 15:06 UTC

Post by *zencoder »

The article you mention is from 1995. It is true that in olden days, there used to be a distinction between base name and extension ( the 8+3 story).

Today, things are a bit different and file "extensions" have no meaning at file system level. In NTFS for example, there's only one "File Name" attribute which represents the fullname:

w w w . ntfs . com/ntfs-files-types.htm

This explains why the DIR command and the Windows Explorer both use the "Name" term instead of fullname, and actually sort on the fullname.

Please try

Code: Select all

DIR /OGN
and test my example in Windows Explorer. So how should things be?

Also, don't you find it strange that TC sorts directories and files differently in my example?
User avatar
Hacker
Moderator
Moderator
Posts: 13067
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

zencoder,
Also, don't you find it strange that TC sorts directories and files differently in my example?
Perhaps:
wincmd.ini
[Configuration]
SortDirExt=

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
zencoder
Junior Member
Junior Member
Posts: 9
Joined: 2008-10-12, 15:06 UTC

Post by *zencoder »

The sorting by extension works, but we're talking about the name:

Code: Select all

SortDirsByName=1
So for directories, TC sorts by name on the fullname, and for files it sorts on the (base) name :?
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

Today, things are a bit different and file "extensions" have no meaning at file system level.
TC (and Explorer too) sorts on operating system level, independent of the used file system.
Explorer cannot sort by extension directly, but by type only ... but this is another story.
The article you mention is from 1995.
Nowadays nothing has changed on OS level (see Windows Vista Help)
Also, don't you find it strange that TC sorts directories and files differently in my example?
Directories never have an extension/filetype !
Type is always "directory", so there is name=fullname.
#5767 Personal license
zencoder
Junior Member
Junior Member
Posts: 9
Joined: 2008-10-12, 15:06 UTC

Post by *zencoder »

Nowadays nothing has changed on OS level
You are right, on OS level - what you see in the Explorer - nothing has changed.

My point is that if you look at the physical file structure, you don't have the distinction. Also everything within NTFS is considered a file, and that applies to directories as well. Extensions are just a trick so that you can associate programs to files, but this doesn't mean you must remove them to sort on the name.

Now back to the subject, you see the following in your TC tab:

b.bb
b.bc
b.bb.1

"bc" is before "bb", how can that be? Doesn't it strike you?

Try the same on Windows Explorer, the Command Prompt, on UNIX, everywhere... what you will see is this:

-rw-r--r-- 1 tiyuhda 5 Oct 15 08:56 b.bb
-rw-r--r-- 1 tiyuhda 5 Oct 15 08:56 b.bb.1
-rw-r--r-- 1 tiyuhda 5 Oct 15 08:56 b.bc

So come on, you must admit that something's not right here.
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

So come on, you must admit that something's not right here.
Again: It just works as designed ...

Click on the Name part column will sort by name part only.
Click on the Ext column will sort by extension part only
Click on full name (custom) column will sort by full name

Just your expectations are different.

May be you are confused by changing the display to show the extension directly after name.
... but this is display only, no changing of functionality !
#5767 Personal license
zencoder
Junior Member
Junior Member
Posts: 9
Joined: 2008-10-12, 15:06 UTC

Post by *zencoder »

When you display the fullname, the sorting should be done accordingly.

My point is that you should look what's happening outside and how things are done in Windows and in other systems: The way TC handles this is not "normal" and it doesn't make sense. I'm confused because it IS confusing.

I understand why it is that way (just look at Norton Commander 1.0), but in 2008 you can't accept to display something with a wrong sorting, meaning something else. The functionality is to have a list of fullnames sorted, and this is not working, hence the bug report.
Post Reply