You are not logged in.
Ok, i have a server with samba where we put the familys music so we don't have to fight over the cdroms, this works fine but the problem is that when loading the music everything gets loaded the reverse order, instead of loading cd1 and its files and then cd2 and then cd3 it does cd3 first and cd2 then cd1. when doing ls on the folder the files appear the right order but if I do find they appear in the cd3,cd2,cd1 order.
What is the problem and is there a way to correct this? (file system is ext2 if that matters)
Offline
That's a feature, not a bug
Offline
Force SMB client to sort list of files returned from server.
Offline
That's a feature, not a bug
How do I turn off this feature then?
Force SMB client to sort list of files returned from server.
I don't think this is a samba-only problem(feature) since it appears when I use find on the server.
Last edited by firedance (2007-10-08 19:21:14)
Offline
I will explain it better.
ls program gets list of all files from directory, sorts the list and outputs it on the screen.
find doesn't do any sorting so filenames are returned in the order they are stored on disk which is usually different than alphabetical order.
If you want find to return them in alphabetical order try moving them back and forth (and maybe after some rounds you will succeed).
Your samba returns files just like find (without any sorting since it doesn't know client locale/language and thus sorting rules). But client does know your locale and is able to sort filenames correctly.
Offline
I will explain it better.
ls program gets list of all files from directory, sorts the list and outputs it on the screen.
find doesn't do any sorting so filenames are returned in the order they are stored on disk which is usually different than alphabetical order.
If you want find to return them in alphabetical order try moving them back and forth (and maybe after some rounds you will succeed).Your samba returns files just like find (without any sorting since it doesn't know client locale/language and thus sorting rules). But client does know your locale and is able to sort filenames correctly.
Ok, I see.
So either I need a program that moves the files on ext2 (I remember seeing something like it for fat32 ment to be used on cheap mp3 players)
or then I need to patch samba to make it sort the files, I don't think i can change the client.
Offline
If all you need to do is to have find return a sorted list, and using a client like nautilus is not possible for your usage, then might I suggest piping the output of find to a sorter. To use this comfortably you can make it an alias.
find trackname | sort <parameters that you can specify according to manpages>
If you want more advanced functionality have a look at sed and/or awk. You might even find some good scripts for this by googling around.
Offline
No that is unfortunately not what I need.
-edit-
but i like your description of the arguments to sort
Last edited by firedance (2007-10-09 12:02:10)
Offline