By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Tree on FAT32 does not sort by name by default.

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.


Rodolfo Giovanninetti

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.
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

I interpret that as meaning that /O by itself — without any sort keys specified — sorts by name. Not that TREE without /O sorts by default.

But I could always be mistaken.
I too thought about this, but "*tree /O:" is the same, it does not sort according to name.


Rodolfo Giovanninetti

Similar threads