On 5/17/24 1:15 PM, Robert Elz wrote:
| If `nosort' means no sorting, there is no imposed ordering, and ascending | and descending are meaningless.Sure, but directory order, and reverse directory order aren't (and that's just a difference between the order in which you create the list as each new dirent is read from the directory - does it go at the head or tail).
That's changing from one random order to another.
But in any case, it apparently isn't documented, if +nosort and -nosortare to mean the same thing, then it should say so.
OK, that's easy enough.
| I'll consider it. What name would you propose for it? Now that's the difficult question, I hate inventing names for things - perhaps "number" or "numeric" or "numname" or ...
I like `numeric'.
All that matters is that it fall back to be "names" if the filenames are not numeric (or at least if they don't start with digits, so atoi() would just return 0), fully numeric names are the only ones that matter to me.
Sure, but what do you prefer to do when you have results with a mix of numeric values and string values? Pre-scan the results before sorting? Let the comparison function handle it?
| Because it's a complication that may or may not be worth implementing | without some critical mass of people asking for it. Let's see how this | goes first. The doc also doesn't indicate what happens when the sort method chosen produces equal answers - that can't happen for names, since the same name can't occur twice in the same directory, but for everything else that's in the list it can. Does it then sort by name, by directory order, or just by whatever order the sort algorithm (qsort?) happens to leave them in when it is done?
Yes, it's unspecified.
Actually, one more option that might be worth adding (as a sort type) might be "random" - giving different results every time the same patternis expanded.
I don't see this as worth the implementation cost. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature