! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Sort by name doesn't actually sort by name
Status:
RESOLVED: DUPLICATE

Comments

Description Mark Wagner 2014-08-10 02:02:38 CEST
If you've got filenames with leading digits, Thunar's "sort by name" produces something that is, at best, vaguely alphabetical.  

To reproduce:
1) Create a folder containing files named "174067164683d23e8808fd3245196a6b.png", "86659359136fe72ae37b7cd8b381b2c2.jpeg", and "377713586156fe6042f4bdf14b771599.jpg"
2) Select "View as detailed list"
3) Click the "name" column

Expected result:  The files sorted in alphabetical order
174067164683d23e8808fd3245196a6b.png
377713586156fe6042f4bdf14b771599.jpg
86659359136fe72ae37b7cd8b381b2c2.jpeg

Actual result: The files are sorted in the order
86659359136fe72ae37b7cd8b381b2c2.jpeg
174067164683d23e8808fd3245196a6b.png
377713586156fe6042f4bdf14b771599.jpg
Comment 1 Helder 2015-01-08 00:06:12 CET
I confirmed this behavior on Thunar 1.6.3.

It happens with files named
86659359136f.jpeg
174067164683.png
but it does not happens with files named
86659359136.jpeg
17406716468.png
Comment 2 Matt32 2015-01-17 14:24:45 CET
I've got the same bug as Mark Wagner on both Thunar (git master) and Caja filemanager (MATE Desktop)
Comment 3 Matt32 2015-01-17 14:32:17 CET
ls | sort -n
86659359136fe72ae37b7cd8b381b2c2.jpeg
174067164683d23e8808fd3245196a6b.png
377713586156fe6042f4bdf14b771599.jpg

Sorting is done by numeric values.
Comment 4 Kelly Price 2018-12-22 21:03:24 CET
This is still continuing.  Thunar 1.6.14, I have the first two letters be a hexadecimal code for sorting properly.  I should have this:

00.Notes.md
01.Boston-1.md
02.Boston-2.md
03.Boston-3.md
04.Boston-4.md
05.Boston-5.md
06.NewHaven.md
08.NewYork.md
09.Secaucus.md
0A.Trenton.md
0B.Trenton-2.md
0C.Trenton-3.md
10.Philly.md
11.Philly-2.md
18.Baltimore.md
19.Baltimore-2.md
20.WashDC.md
24.WashDC.md
28.Pittsburgh.md
30.Cleveland.md
38.Chicago.md
39.Chicago.md
3A.Chicago.md
3B.Carbondale.md
40.StLouis.md
41.StLouis.md
48.Dallas.md
49.Dallas.md
50.Albuquerque.md
50.Houston.md
58.Dallas.md
58.Tuscon.md
60.Phoenix.md
68.LasVegas.md
70.LosAngeles.md
78.SanJose.md
80.Metroburg-1.md
88.Portland.md
90.Seattle.md
98.Metroburg-Home.md
9F.Metroburg-Home.md
S2S-Beds.txt
S2S-Train.md
S2S-Train.md~

Instead, I get the screenshot which I'm attaching.  We should be sorting by ASCII/Unicode, not numerically!
Comment 5 Kelly Price 2018-12-22 21:04:07 CET
Created attachment 8194 
How is shows in Thunar, ie, badly.
Comment 6 Kelly Price 2018-12-22 21:09:03 CET
This may be a GTK issue.  The File Open box has the same exact problem!
Comment 7 Arthur Jansen 2018-12-28 00:51:46 CET
File names are also sorted in this way for me. However if we have the situation of a directory with three files: "1.png", "2.png" and "11.png", the current behaviour will sort them in this order:

- 1.png
- 2.png
- 11.png

Now, if I understand it correctly, solving this bug would change it to this order (this is the output of "ls | sort"):

- 11.png
- 1.png
- 2.png

Which, in my opinion, is not expected behaviour.
Comment 8 Kelly Price 2018-12-28 01:35:09 CET
The current behaviour (numerical sort with "extension" handling) is the former, which is mangled badly in my example.  Expected behaviour (which matches that of Windows, MacOS, iOS, etc) is the latter.
Comment 9 Theo Linkspfeifer editbugs 2019-04-23 21:14:09 CEST
Bug 10672 addresses the issue with filename sorting already.

*** This bug has been marked as a duplicate of bug 10672 ***

Bug #11075

Reported by:
Mark Wagner
Reported on: 2014-08-10
Last modified on: 2019-04-23

People

Assignee:
Jannis Pohlmann
CC List:
5 users

Version

Attachments

How is shows in Thunar, ie, badly. (209.77 KB, image/png)
2018-12-22 21:04 CET , Kelly Price
no flags

Additional information