Tree on FAT32 does not sort by name by default.

May 20, 2009
258
2
54
ITALY
I found that on a FAT32 disk the tree command does not sort by name by default.
Instead, it seems that it sorts by time-stamp.
I have not been able to reproduce this issue on NTFS nor on network drive.


Regards

Rodolfo Giovanninetti

2291
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,856
48
Albuquerque, NM
prospero.unm.edu
AFAIK, TREE does not sort at all by default. It just lists directory entries in the order they appear on the disk. The behavior you're seeing is just the way that the underlying file system works.

On NTFS, the filesystem itself sorts directory entries by name, though not necessarily in the same order that DIR would.

On FAT, it's essentially random. Older items will tend appear first, but that isn't guaranteed. Deleting an older file can open up a slot that may be reused by a newer file.
 
May 20, 2009
258
2
54
ITALY
Thank You for the help.
Right now I have not access to that system, but I put here a part of the on-line help, that says the same thing.
It says, regarding the /O option, that by default the tree command sorts by name.
So, maybe it is an issue of the documentation, not of the software.

Thank You again and regards

Rodolfo Giovanninetti

2292
 
May 20, 2009
258
2
54
ITALY
I too thought about this, but "*tree /O:" is the same, it does not sort according to name.

Regards

Rodolfo Giovanninetti