Linux needs to be taught how to count... - Questions

This is a discussion on Linux needs to be taught how to count... - Questions ; How does one get Linux to not automatically sort the directory contents by number? 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 ...

+ Reply to Thread
Results 1 to 14 of 14

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

  1. Linux needs to be taught how to count...

    How does one get Linux to not automatically sort the directory contents by
    number? 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. It's like Linux cannot count properly. Or is doing it by
    translating hex numbers or something. Whatever, I have to burn the cdrom
    in Windows to get it right. And that's unacceptable, that means I have to
    install windows.....




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

    The files are ordered lexically.
    You need to run "sort -n" on them to get them ordered as you want.
    paul wrote in message news:...
    > How does one get Linux to not automatically sort the directory contents by
    > number? 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. It's like Linux cannot count properly. Or is doing it by
    > translating hex numbers or something. Whatever, I have to burn the cdrom
    > in Windows to get it right. And that's unacceptable, that means I have to
    > install windows.....


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

    paul wrote in message news:...
    > How does one get Linux to not automatically sort the directory contents by
    > number? 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. It's like Linux cannot count properly. Or is doing it by
    > translating hex numbers or something. Whatever, I have to burn the cdrom
    > in Windows to get it right. And that's unacceptable, that means I have to
    > install windows.....


    It's sorting them like strings...

    But the way to sort them like string would be

    1 10 100 101 102 103 104 105 106 107 108 109 11 110 111 112 113 114
    etc.

    I've noticed that too in linux...

    I'm still working on how to fix it... I'll e-mail you or something if
    I find a solution

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

    paul wrote in message news:...
    > How does one get Linux to not automatically sort the directory contents by
    > number? 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. It's like Linux cannot count properly. Or is doing it by
    > translating hex numbers or something. Whatever, I have to burn the cdrom
    > in Windows to get it right. And that's unacceptable, that means I have to
    > install windows.....


    A silly way would be to arrange them with Modification Date order and
    then select Reversed Order...

    That will only work though if 1 is older than 2, 2 is older than 3, 3
    is older than 4, etc. etc. etc., 244 is older that 255...

    cmad

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

    In comp.os.linux.admin Chris Mantoulidis wrote:
    > paul wrote in message news:...
    > > How does one get Linux to not automatically sort the directory contents by


    Linux doesn't sort directories. Your application lists a directory any
    way it likes.

    > > number? 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. It's like Linux cannot count properly. Or is doing it by


    Lexical ordering. Set your application to use some other ordering if
    you don't like that. Maybe you'd prefer reverse polish?

    > > translating hex numbers or something. Whatever, I have to burn the cdrom
    > > in Windows to get it right. And that's unacceptable, that means I have to
    > > install windows.....

    >
    > A silly way would be to arrange them with Modification Date order and
    > then select Reversed Order...


    If he can arrange them, he can arrange them the way he likes!


    > That will only work though if 1 is older than 2, 2 is older than 3, 3
    > is older than 4, etc. etc. etc., 244 is older that 255...


    It will only work if he can "arrange them". And if he can, then he
    should arrange them to his taste.

    If it were me I would set LC_COLLATE to something suitable and see if
    his app observed the instruction! If the app doesn't have a "sort
    order" button, that is.

    Peter

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

    On Mon, 15 Dec 2003 16:30:21 +0000, P.T. Breuer wrote:

    >> paul wrote in message
    >> news:...
    >> > How does one get Linux to not automatically sort the directory
    >> > contents by

    > Linux doesn't sort directories. Your application lists a directory any
    > way it likes.


    Wasn't there a kernel patch or option or something which did sort
    directories on ext[23]? I'm pretty sure I saw one somewhere...


    >> > number? 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. It's like Linux cannot count
    >> > properly. Or is doing it by

    > Lexical ordering. Set your application to use some other ordering if you
    > don't like that. Maybe you'd prefer reverse polish?


    Offhand, I can't think of any applications which will let me select the
    sort order of a file listing (talking strictly about file names here).
    Even Nautilus only offers a choice of "sorted" vs. "unsorted". Now, we
    can add "LANG=" to the sorting options list, but that doesn't really count
    in this discussion, since that will change sorting globally across the
    app.


    >> > translating hex numbers or something. Whatever, I have to burn the
    >> > cdrom in Windows to get it right. And that's unacceptable, that means
    >> > I have to install windows.....

    >> A silly way would be to arrange them with Modification Date order and
    >> then select Reversed Order...

    > If he can arrange them, he can arrange them the way he likes!


    Not necessarily. To take Nautilus as an example again, how would I get
    the files in a directory view to be sorted in numeric order (appart from
    dragging them around, which may not be an option in his application).


    >> That will only work though if 1 is older than 2, 2 is older than 3, 3
    >> is older than 4, etc. etc. etc., 244 is older that 255...

    > It will only work if he can "arrange them". And if he can, then he
    > should arrange them to his taste.


    As above, considering that any number of applications provide a few fixed
    sorting schemes such as date, size, and so on. But very few allow for
    non-simple (other than the language collation sequence) sorting of names.


    > If it were me I would set LC_COLLATE to something suitable and see if
    > his app observed the instruction! If the app doesn't have a "sort order"
    > button, that is.


    Could you, then, continue your good advice by suggesting an LC_COLLATE
    setting which will put "some5.pic" before "some10.pic" (as per the OPs
    question)?


    Fredderic

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

    Fredderic wrote:
    > Could you, then, continue your good advice by suggesting an LC_COLLATE
    > setting which will put "some5.pic" before "some10.pic" (as per the OPs
    > question)?


    IMO, the best way is to name them "correctly". "some5.pic"
    should be "some0005.pic", "some10.pic" should be
    "some0010.pic". Depending on the number of files you expect
    to collect in that directory you might need to make it
    "some0000005.pic" or the like.


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

    In comp.os.linux.admin Fredderic wrote:
    > On Mon, 15 Dec 2003 16:30:21 +0000, P.T. Breuer wrote:
    >
    > >> paul wrote in message
    > >> news:...
    > >> > How does one get Linux to not automatically sort the directory
    > >> > contents by

    > > Linux doesn't sort directories. Your application lists a directory any
    > > way it likes.

    >
    > Wasn't there a kernel patch or option or something which did sort
    > directories on ext[23]? I'm pretty sure I saw one somewhere...


    In what sense? Entries in a directory "really" go any old way.
    Whenever you type "ls" you see them sorted in the order dictated by
    LC_COLLATE. That's what ls does.

    There is a kernel patch to do binary tree access instead of linear access
    to the dir entries in ext2, AFAIR.


    > > Lexical ordering. Set your application to use some other ordering if you
    > > don't like that. Maybe you'd prefer reverse polish?

    >
    > Offhand, I can't think of any applications which will let me select the
    > sort order of a file listing (talking strictly about file names here).
    > Even Nautilus only offers a choice of "sorted" vs. "unsorted". Now, we


    Dir listing. I don't use file browsers. Apart from ls. Which does.

    > can add "LANG=" to the sorting options list, but that doesn't really count


    LC_COLLATE.

    I gave him the clue.

    > in this discussion, since that will change sorting globally across the
    > app.


    That's what he wants.

    > >> A silly way would be to arrange them with Modification Date order and
    > >> then select Reversed Order...

    > > If he can arrange them, he can arrange them the way he likes!

    >
    > Not necessarily. To take Nautilus as an example again, how would I get
    > the files in a directory view to be sorted in numeric order (appart from


    I don't know what nautilus is (some gnomish thing?). But I'd set
    LC_COLLATE when calling it, and see what happens.

    > dragging them around, which may not be an option in his application).


    It depends on his app.

    > As above, considering that any number of applications provide a few fixed
    > sorting schemes such as date, size, and so on. But very few allow for
    > non-simple (other than the language collation sequence) sorting of names.
    >
    >
    > > If it were me I would set LC_COLLATE to something suitable and see if
    > > his app observed the instruction! If the app doesn't have a "sort order"
    > > button, that is.

    >
    > Could you, then, continue your good advice by suggesting an LC_COLLATE
    > setting which will put "some5.pic" before "some10.pic" (as per the OPs
    > question)?


    uh .... no. I don't think that was his question, but I may well be
    mistaken! There is no way to know that some5.pic should come before
    some10.pic, becuase I know of no ordering in which 5 comes before 1.
    I suggest he renames it some05.pic and then all will be hunky.




    Peter

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

    P.T. Breuer wrote:

    > I don't know what nautilus is (some gnomish thing?).


    For someone who doesn't know, you guess real good! )

    --
    Garry Knight
    garryknightgmx.net ICQ 126351135
    Linux registered user 182025

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

    On Tue, 16 Dec 2003 17:19:36 -0600, "Kevin D. Snodgrass" wrote:

    > IMO, the best way is to name them "correctly". "some5.pic"
    > should be "some0005.pic", "some10.pic" should be
    > "some0010.pic". Depending on the number of files you expect
    > to collect in that directory you might need to make it
    > "some0000005.pic" or the like.



    .... agreed

    --
    << http://michaeljtobler.homelinux.com/ >>
    Captain Penny's Law: You can fool all of the people some of the
    time, and some of the people all of the time, but you Can't Fool Mom.

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

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    ["Followup-To:" header set to comp.os.linux.admin.]
    On 2003-12-17, P.T. Breuer wrote:
    > In comp.os.linux.admin Fredderic wrote:


    >> Could you, then, continue your good advice by suggesting an LC_COLLATE
    >> setting which will put "some5.pic" before "some10.pic" (as per the OPs
    >> question)?

    >
    > uh .... no. I don't think that was his question, but I may well be
    > mistaken!


    Okay...do you really expect someone who can't recognize lexical
    ordering to be able to set LC_COLLATE?

    > There is no way to know that some5.pic should come before
    > some10.pic, becuase I know of no ordering in which 5 comes before 1.
    > I suggest he renames it some05.pic and then all will be hunky.


    The OP would probably have gotten this answer a lot sooner had he
    not been such a putz about posting his question (stupid x-post,
    blaming linux when PEBKAC, not describing anything about the
    apps he was using).

    - --keith

    - --
    kkeller-usenet@wombat.san-francisco.ca.us
    (try just my userid to email me)
    AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.3 (GNU/Linux)

    iD8DBQE/37WkhVcNCxZ5ID8RAnGwAJ0SFZKl/Uu0RGmKNb/Und++mU+yKwCfaJQc
    HlbvsxSnBphS7rioP/QAqX0=
    =q7/2
    -----END PGP SIGNATURE-----

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

    Fredderic wrote:

    > Offhand, I can't think of any applications which will let me select the
    > sort order of a file listing (talking strictly about file names here).
    > Even Nautilus only offers a choice of "sorted" vs. "unsorted". Now, we
    > can add "LANG=" to the sorting options list, but that doesn't really count
    > in this discussion, since that will change sorting globally across the
    > app.


    Offhand, I can't think of any KDE application which does *not* let me select
    sort order.

    -- robin


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

    Forget it.... Need to learn how to read...

    -- robin

    Robin Rosenberg wrote:

    > Fredderic wrote:
    >
    >> Offhand, I can't think of any applications which will let me select the
    >> sort order of a file listing (talking strictly about file names here).
    >> Even Nautilus only offers a choice of "sorted" vs. "unsorted". Now, we
    >> can add "LANG=" to the sorting options list, but that doesn't really
    >> count in this discussion, since that will change sorting globally across
    >> the app.

    >
    > Offhand, I can't think of any KDE application which does *not* let me
    > select sort order.
    >
    > -- robin



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

    On Wed, 17 Dec 2003 12:51:58 +0000, Robin Rosenberg wrote:

    >> Offhand, I can't think of any applications which will let me select the
    >> sort order of a file listing (talking strictly about file names here).
    >> Even Nautilus only offers a choice of "sorted" vs. "unsorted". Now, we
    >> can add "LANG=" to the sorting options list, but that doesn't really count
    >> in this discussion, since that will change sorting globally across the
    >> app.

    > Offhand, I can't think of any KDE application which does *not* let me select
    > sort order.


    And what sort orders do they let you select? Lexical, time, size, type...
    reverse... probably only one field at a time.

    What I'm talking about (and the OP) is an obvious, natural, but
    not-quite-trivial ordering that is supported by some systems. The
    important term here being "obvious". It is the way humans count, and
    IMHO, being relatively easy to implement, should be better supported.


    Fredderic

+ Reply to Thread