12

I know this sounds a bit strange, but for some reasons, my car audio system is displaying the folders in the order it has been copied. There is no setting in the system to display the folders in an alphabetical order. This is really annoying as I have about 30GB of music which means a lot of folders and every time I add a new folder, it will be added at the end of the list... Also it is not practical at all when you want to search for something particular.

So I guess the system is reading the files in the order it has been recorded in the FAT32 record table. So the question is simple. Is there a way to reorder this record in an alphabetical order?

0
7

I have not tried this, but a google search lead to a result which seems almost perfect here. FAT-32 Sorter. It even describes pretty much exactly the problem you are having. I hope this helps.

1
  • Thanks, looks like what I need. I will try this as soon as possible.
    – Ucodia
    Jan 10 '12 at 9:43
3

It's not strange. Sorting the list requires "a lot" of memory, which may not be available on small embedded systems like MP3 players. You need a big enough array to store all the filenames before sorting them.

Therefore those systems just list the files in whatever order the directory entry stores its child items and remove the need for the array, since now you just load a single filename instead of the full directory listing.

You can manually sort the files by moving them to another directory in the order you want

If the storage medium is a FAT-formatted USB thumb drive, then the files will be enumerated in a complex order based on the order in which files are created and deleted and the lengths of their names. But the easy way out is simply to remove all the files from a directory then move file files into the directory in the order you want them enumerated. That way, the first available slot is the one at the end of the directory, so the file entry gets appended.

What order does the DIR command arrange files if no sort order is specified?

Or just use the tools made for this sorting purpose

1
  • 1
    Thanks for YAFS, works perfectly for my device
    – userlond
    Nov 12 '20 at 6:33
2

Another option that avoids the need for specific utility and allows you to set the sequence in any order you want, is to simply rename the files or folders on the FAT32 drive.

I have a USB flash drive I use in my car audio system (which plays files and folders in the order found on the drive) and I use this technique to set the order of the folders and thus the order that the audio system sees them.

My observation is that if a file or folder is renamed to a longer name, the directory entry is recreated at the end of the directory, and so would then appear to be last in the playing order. I can then rename it back to its original name and it will keep its new position. I then repeat this process with each folder or file until they are in the order I want. Start with the item you want second, then the item you want third and so on.

To make this process a bit less tedious, as small batch file can be used:

ren %1 %1-padding
ren %1-padding %1
dir
1
  • Just a note: name of temporary file (i.e. "renamed to a longer name"), should be greater than the initial filename (with which file was recorded on disk)
    – userlond
    Nov 12 '20 at 6:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.