Unexpected sorting in the file display

Hi guys, just a quick question! o)

I am out of ideas what to do.. I searched preferences and a bit in the forum, to no avail.

Why is the 32GB SanDisk sorted in the middle?
Why is there 120GB Intenso at the top and also at the bottom?

There probably is a setting somewhere to influence how DO does the sorting, but I could not find any!? o)

Thank you! o)

Uh! I tried some checkboxes in the current folder format (this is a Find result)..

The "Sort name and extension separately" checkbox unchecked, gives the expected sort order!
Since these are folders without an extension (obviously o), is this expected behaviour?

EDIT: In the forum I read this thread beforehand, it seems related, but it is about actual files, not folders.

What is this view ? MyComputer ? A folder showing drives ??
That's kind of weird.
Plus the dots in the "names" (filenames ? drive names ?) does not help sorting understanding.
I was trying to reproduce, but I don't have that many drives so I was trying with folders ... but it might behave differently.

These are simple folders, listed in a Find result.

That's not what I see : STG_SATA_SSD_2.5_ ... : the dot between 2 and 5 makes it a folder with an extension

Hehe! Now that you say it.. I think I see! o)

Mhh.. I have to think about that for a moment.. thank you! o)

1 Like

And in your first capture, the last selection even has another dot at the end (06.09) which even goes for another extension :slight_smile:

I would agree to your finding.. but extensions on folders, is it a thing? Do they exist?
I don't know.. I would say, folders do not have an extension, hu?..

Well it depends on what definition you use for extension :slight_smile:
If you consider that is what defines the file type (event though, it would more really be its magic number) and helps the system to understand what actions to take under certain circumstances (double click, and so on) : then folders don't really have extension.
If you consider that the extension is what goes after (with or without) the last dot that can be found in its name, then, yes, folders can have extensions (even if that's not widely used ... it sure exists and is allowed on many filesystems).

It seems that Directory Opus treats files and folders the same (e.g. in scripting reference, they are both items that can be directories, files, links, ...)

Buf if these were files, I can't really make much sense of the sort order either (the mixed one in the first screenshot I mean).

NAME
STG_SATA_SSD_2.5___120GB_Intenso
STG_SATA_SSD_2.5___120GB_Intenso
STG_SATA_SSD_2.5___120GB_Intenso
STG_SATA_SSD_2.5___120GB_Intenso_black_from_Sali-in-OVP
STG_SATA_SSD_2.5___120GB_Sunbow
STG_SATA_SSD_2.5___120GB_Sunbow
STG_SATA_SSD_2.5___128GB_BERLARIBERBARIS
STG_SATA_SSD_2.5___240GB_BERLARIBERBARIS_#1of2
STG_SATA_SSD_2.5___240GB_BERLARIBERBARIS_#2of2
STG_SATA_SSD_2.5___240GB_Intenso_High_from_Sali-in-OVP_1of2
STG_SATA_SSD_2.5___240GB_Intenso_High_from_Sali-in-OVP_2of2
STG_SATA_SSD_2.5___250GB_Intenso_Performance
STG_SATA_SSD_2.5___256GB_ADATA_DP900_256GB-DL3_Win10-BootAnythingSSD
STG_SATA_SSD_2.5___525GB_Crucial_CT525MX300SSD1_MX300
STG_SATA_SSD_2.5___256GB_Crucial_MX500_CT250MX500SSD1__1of2
STG_SATA_SSD_2.5___500GB_Crucial_MX500_CT500MX500SSD1_#where
STG_SATA_SSD_2.5___500GB_Samsung_850_EVO_VonIngaWieNeu
STG_SATA_SSD_2.5___500GB_Verbatim
STG_SATA_SSD_2.5____32GB_SanDisk_SDSSDRC-032G
STG_SATA_SSD_2.5____60GB_aus_SSD+HDD_Paket!#todo
STG_SATA_SSD_2.5____64GB_SanDisk_SDSSDP-064G
#P20230218-01.17
STG_SATA_SSD_2.5___120GB_Intenso_High_#P20231007-06.09
STG_SATA_SSD_2.5___120GB_Samsung_840_EVO__#P20230227-01.10
STG_SATA_SSD_2.5___128GB_Samsung_MZ-5PA128A_#P20230415-03.10
STG_SATA_SSD_2.5__1000GB_Samsung_850_EVO_(2017-10)_#warning-crashed

Given that the "Extension" is everything behind the dot in the folder name. Does this sort order make any sense to you, with "Sort filename and extension separately" being enabled (first screenshot)?

.5___120GB_Intenso
.5____32GB_SanDisk_SDSSDRC-032G
.5___120GB_Intenso_High_#P20231007-06.09

It rather seems to me, that the "extensions" of my folders aren't sorted at all?
EDIT: Or at least they get sorted in some way I don't really understand! o)

First, it sorts by name : HDD first, then all your SSD have the same start name.
Then it sorts by extension :

  • 5___120GB_Intenso before 5____32GB_SanDisk_SDSSDRC-032G because it considers that numbers come before _
  • then comes the last one which extension is .09 which is considered greater than .5 because you activated numeric order (opus understands that 09 actually is 9 and is greater than 5)

Or maybe it's because only the last "dot" is separating parts of the folder name into an "extension", but nah.. also does not make sense, when I see "17" being listed before "10".. I don't know! o)

Mhh, the checkbox for "Numeric order filename sorting" does not make a difference!
Not sure it has something to do with it.

For now I activated the "Sort" tab in the folder format for "Find Result" and disabled the checbox for separate sorting of filename and extension, what ever greater logic is behind, I can sort the way my brain understands with these settings, thank you! o))

image

Remember that it first sorts by filename.
You can try and sort by extension if you add the extension column to understand what goes on.

So what happens :

  • As said HDD first,
  • Then all "STG_SATA_SSD_2" and then by their extension. That means that your files that have another dot in their name will go after that. Exact list here :
  • Then first file/folder that comes is STG_SATA_SSD_2.5____64GB_SanDisk_SDSSDP-064G#P20230218-01 because its name sorts before STG_SATA_SSD_2.5___120GB_Intenso_High_#P20231007-06
  • And all the other files are sorted by their name (full name until last dot). Extension has no chance to be taken into account because the names are already different, which was not the case for the first batch of files (cf. screenshot).

The only thing that bothers me is that, in the first sorting operation (when it sorts by extension all folders having the same name) :
STG_SATA_SSD_2.5___525GB_Crucial_CT525MX300SSD1_MX300
is before
STG_SATA_SSD_2.5____32GB_SanDisk_SDSSDRC-032G
which leads to '_' > '5' (a number)

But in the second part, when it sorts by the name stem of the folder, then :
STG_SATA_SSD_2.5____64GB_SanDisk_SDSSDP-064G#P20230218-01
is before
STG_SATA_SSD_2.5___120GB_Intenso_High_#P20231007-06
which means '_' < a number.

And if '_' were ignored, then _32 would be before 525 ...

Apart from that, sorting seems legit to me.

@Leo : any idea why sort order between '_' and numbers is different when considered in the name stem and in the extension ?
image

"Apart from that.." muha.. o) So you find irritating things in both variants? o)

Yes, "_" is < than a number (unless you are on Linux with their weird collation settings.. o). On Windows I always prepend filenames or folders with "_" to get them up to the top of the list.

"Sort name and extension separately" DISABLED:

"Sort name and extension separately" ENABLED:
It is how I thought, the extensions are very different, since only the part after the last "dot" is taken into account, you can't get a sensible sorting that way (means, with how my folders are named! o)?!

And yes, that's what I was thinking as well.. the "_" is handled and sorted differently when encountered in the extension? I'm not 100% sure though.. simple things getting complex again. o)

Here, this is the proof? When sorting the extension, it's quite obvious, that "_" is not < any number anymore?
EDIT: I would expect the 32GB - 80GB entries to appear at the top, when sorting the extension "ascending".

You've probably turned this on:

Preferences / Miscellaneous / Advanced: [Information Display] display_folder_extensions

Turn it off, then refresh the file display.

That's what I meant in my last screenshot :
image

Filename sorting : _.* / 0.* / 1.*
Extension sorting with the 1.* files : 1.0 / 1.1 / 1._ / 1.txt