Re: Linux needs to be taught how to count...

From: Sybren Stüvel (sybrenUSE_at_YOURthirdtower.imagination.com)
Date: 12/14/03


Date: Sun, 14 Dec 2003 18:58:44 +0100

On Sun, 14 Dec 2003 17:45:49 +0000, paul wrote:

> How does one get Linux to not automatically sort the directory contents
> by number?

Because, as with everything else that is text-based, it is sorted by ASCII
code. That means that everything that starts with a 4 is smaller than
everything that starts with a 5. With "255.mp3" your computer sees a two,
two fives and ".mp3". Why should it interpret the numeric part of the file
name as 2*100+2*10+5? Now if you named your files "1" through "255"
without the .mp3 it would make some kind of sense (since the entire
filename is numeric) but not with non-numeric parts in it.

> I have a CDROM of 225 MP3's that are named one though two-hundred-twenty
> five. (1-255). When I go to burn the cdrom the programs automtically
> re-arrange the order, 1-9,then 100, 102 etc through 110, then 11, then
> 111 etc.

Which is the proper way. If you want everything to be ordered by number,
name them 001.mp3, 002.mp3 etc. Why do you care about the order in which
the files are burned anyway?

> It's like Linux cannot count properly.

It can, trust me.

Sybren

-- 
(o_   Q: God, root, what is difference?
//\   A: God can change the byte order on the CPU, root can't.
V_/_


Relevant Pages

  • Re: Gaim help!
    ... That should take care of all ... dependencies. ... God can change the byte order on the CPU, root can't. ...
    (alt.os.linux)
  • Re: questions qasas 28:1-7
    ... it is from the same root. ... There were others in the land besides Jews and some of them were ... sons are killed then there are no heirs. ... in 28:5 god wants to make these ...
    (soc.religion.islam)
  • of causation of 911
    ... The Evangelicals claim money is the root of all evil and the Buddhists ... Om sri Raama jaya Raama jaya jaay Raama. ... (God, homage to Raama hail Raama hail hail Raama.) ...
    (soc.culture.indian)
  • Re: Why Longhorn will be Open Source
    ... Why not get a real usenet program? ... usually best to add a Followup-To header, so you do get attention from ... God can change the byte order on the CPU, root can't. ...
    (comp.os.linux)
  • Re: Installing RH 6.0 on Compaq Deskpro 4000
    ... If you keep to ancient versions of Linux: ... I wouldn't stick to redhat if I were you. ... God can change the byte order on the CPU, root can't. ...
    (comp.os.linux)