I wish to understand how is the sort order for displaying files in Dolphin determined.
I ask because I have a list of 50+ files which include in their file name “[Disk_X]” where X is 1 to 56.
Even with leading zeros missing they still display in correct order in Dolphin
However when I look at same directory with Puddletag I get a different order with files with single digit numbers shown at end of decade eg: [Disk_1] follows [Disk_19]. [Disk_2] follows [Disk_29] etc.
I have solved the problem by including leading zeros but am interested to learn what determines the sort order in each case.
Budgie2
Puddletag is sorting “correctly” based on the ASCII representation of the filename.
Dolphin is sorting using “Natural sorting of items” (Changeable from dolphin settings "Settings -> Configure Dolphin -> General -> Behaviour - Natural sorting of items).
(I’ve no idea if Puddletag’s sorting is configurable…)
Hi and thanks for the reply. I understand what you have written but have no idea what criterion is used for “Natural Sorting of Items” or even that this mode existed.
Further down the line these files are stored on a NAS, served by server (minimserver) and played using a control point which can also display files in some modes. It would be good to have them all using the same criterion when displaying directory listings. I guess the “correct” way will be safest but maybe putting a number as first character would be safest until I know more.
And even that is approximation of what may be the “correct” way of sorting. As Linux file names are nowadays in Unicode, ASCII is only a subversion of what could/should be a “correct” sorting. The collating sequence of characters in scripts is a factor here. Please do not guess that this is something that only emerges when using “exotic” alphabets. Even German has (at least) two types of sorts. One where e.g. ü comes somewhere after z (used in a dictionary like Duden) and one where ü is near ue (in a telephone directory). The last case means that the family names Müler and Mueler are found together in case you are not sure which one of those, having the same pronounciation, to look for.
I type all this to show that not only “natural” sorting has a lot of personal preferences, but even “correct” can be difficult to define.
I am afraid that software that claims to do one or more of both may offer you bewildering results depending on your personal interpretation of the words "corerct’, “natural” and the contents of environment parameters like LANG.