DaveS
29 November 2020 23:56
1
Has anyone else noticed when you tell Finder to “sort by name” its strange?
I have 255 files named “file$XX.dat” where XX is 00 to FF
now I don’t expect them to be sorted in NUMERIC order…
but I don’t expect THIS order
$5E $5F $06 $6A $6B $07 $08 $09 $10 ..... $19 $21 ...$33 $40
I would expect them to be sort by the alphanumeric name
$00 ... $0F
$10....$1F
etc.
DaveS
30 November 2020 00:58
3
yes, yes it is…
not only that but the Xcode Asset Catalog, sorts them the same strange way
as does this method I wrote about “Sorting like finder” way back
Its really curious since its not considering the $XX part as numeric OR lexical
Very odd
DaveS
30 November 2020 06:08
5
but in any comparison method… ."$06" is LESS than “$5E” …
It makes it really hard to find a file (via EyeBall Reader 1.0) when they are not in the order expected.
Unless it ignores the $ and the leading zero.
DaveS
30 November 2020 06:23
7
true… but its still “wrong”
DaveS
30 November 2020 06:31
8
I have found articles that discuss this (or something similar) and eludes to a difference between “sort by” and “arrange by”… but none of the “solutions” seem to be able to be applied in Catalina
If that is the case, someone (probably an intern or someone with reduced experience) thinks that it is right <shakesHead/>
I also have NSStringArraySortMBS in the plugin, which sorts a Xojo array using NSStringCompareMBS , which also uses Apple’s sorting including the sort by number option.
Seems like it doesn’t work for hex numbers, but it works fine for numbers.
Yeah I cant figure what they are doing that things come out the ay they are
Its not obvious
DaveS
30 November 2020 15:30
12
Christian… its not a “hex” number it is two alphanumeric characters. Finder should not be attempting to derive a “context” from a file name
DaveS
1 December 2020 23:59
14
This is not sorting filenames using Xojo… it is sorting them in Finder… so no manipulation of the filename is possible
I get that. Just my take on what MacOS is doing “under the hood”. No idea why…
Are you seeing the same thing if the files don’t have the “$” prefix?
DaveS
2 December 2020 00:50
16
I created another set of files that used $xxx where xxx was completely numeric, and those sorted correctly
Tim
2 December 2020 01:32
17
You know what it looks like to me?
It looks like handling designed to accommodate designers, these weird people who don’t source control their work, who might name a document:
Doc-a
Doc-a1
Doc-a1-good
Doc-a1-new-good
and so on…
DaveS
2 December 2020 01:47
18
That doesn’t explain seeing this order…
thats about what I thought it might be doing but that would give something different than
$5E $5F $06 $6A $6B $07 $08 $09 $10 … $19 $21 …$33 $40
as the $06 $07 $08 $09 would be closer to the beginning of the list
Its really a weird organization
Did you guys not see my earlier reply?
MacOS treats numbers as a single character for sorting.
The list is sorted exactly the way MacOS was designed to. Stupidly. But that’s the way it’s done it for like 20 years.