Compares directory entries alphanumerically (case-sensitive).
Numbers are compared without sign, i.e. "-" is not taken as a sign of following numerical values. The following list of files would be in ascending order (examples are ASCII and numbers only for simplicity):
- 1zzz.txt
- 2xxx.txt
- 19uuu.txt
- 100aaa.txt
- file1z.txt
- file5a.txt
- file5z.txt
- file30z.txt
- file200a.txt
- temp+5.txt ('+' is lexically lower than '-')
- temp-5.txt ('-' is not a sign)
- temp-100.txt (100 is bigger than 5, no sign)
- Parameters
-
[in] | A | first directory entry |
[in] | B | second directory entry |
- Returns
- comparison result (-1, 0, or +1)
- Return values
-
- Note
- This comparison is not (yet) UTF-8 aware:
- UTF-8 characters are compared according to their binary values.
- Locale settings may influence the result in unexpected ways.
- The latter is particularly true for fl_casenumericsort(). This may be changed in a future release.
- Todo:
- Make comparison UTF-8 aware.
- See also
- fl_casenumericsort()