Quote:
Originally Posted by vishesh
I think rizhun is right, samba is nor responsible for sorting
thnks
|
To sum up what we have here:
- Local NTFS using 'dir' command w/o parameters: sorted by name
- Samba (ext3) using 'dir' command w/o parameters: no sorting whatsoever
- Same ext3 dir using 'ls' command w/o parameters: sorted by name
Been doing some reading, and I think I know why the above happens. NTFS has a so-called "Master File Table" (MFT), which describes all file properties per directory. The 'dir' command uses this information to build the file list, and apparently the files are sorted by name in the MFT. The ext3 volume does not seem to have a MFT equivalent, I think the 'ls' command does the sorting by name by default, at least --help seems to indicate that:
--sort=WORD: sort by WORD instead of name: none -U, extension -X, size -S, time -t, version -v
A 'dir' command on the ext3 (samba) FS will not find an MFT nor will it perform sorting by default, so files are shown in the order they're actually stored on disk.
Please correct me if I've gone horribly wrong somewhere.