7

My car can read audio files from a FAT32 flash drive. I have a folder for each artist on the drive, and audio files in those folders.

However the car does not read the folders alphabetically, but by the order they were added to the drive. I can use DriveSort to sort the drive after I add a new artist, but it has a GUI. Is there a similar tool that could do this sorting from the command line?

1
  • 2
    What's the make and model of your audio player? Please edit your question and enlighten us. May 15, 2015 at 12:22

3 Answers 3

2

Date/Time Ordering

Assuming that it is actually using the date/time rather than the physical order you could use the old UNIX favorite touch to set the dates of files and/or directories, a collection of windows versions of some of the most used Unix/Linux command line tools is MSYS.

FAT32 Ordering

Since it looks like that will not work on some media players, as they use the FAT entry order, you could use python with the construct library and the excellent v-fat shuffler script written by Mike Kazantsev as described in his blog and released on github.

A couple of words of caution

  1. As far as I can see the script referenced above should work nicely but I don't have your media player to try it on ....
  2. Unplugging your player before the script is finished might leave you with a corrupted FAT, i.e. a broken player.

Prerequisites

  • You will need to install Python 2 - 32 bits from here - It is free.
  • You will also need the construct library installed - pip install construct - also free.
  • Download the code and try it.

Downloadable Executable of V-FAT Shuffler

To save installing all of the above I have used py2exe to build the above into an executable and have placed the zip on my Google Drive this zip file includes the Microsoft Visual C++ Redistributable that you will probably need, the source code and a dist directory which you should be able to use.

You can get instructions on how to use by running, in the dist directory:

vfat_shuffler.exe --help

I have had very limited time to test this so if it works for you please let me know.

4
  • Worth a try, although "the order they were added to the drive" may very well be the sequential number of the directory entries (1,2,3...), in which case the date order may not match the sequential order if folders were moved around, renamed etc. BTW There are enough separate Windows touch tools so that you don't have to install an collection.
    – user416
    May 15, 2015 at 7:53
  • @JanDoggen - true enough there are a lot of separate touch tools but I tend to have the approach of if you need sticking plasters for in the car you might be better getting a first aid kit... May 15, 2015 at 8:02
  • @StevenPenny - Sorry should have added that the current version shuffles - if it works for you I canadd some options to sort, with the default being ascending alphabetical and options for descending+random and anything else that seems reasonable, and post the new exe. May 25, 2015 at 5:27
  • Fair enough - I am not interested in modifying code for someone that is not prepared to test so we are quits. May 25, 2015 at 6:34
2

Some command line tools for that purpose:

  • YAFS: Yet Another FAT Sorter

    YAFS (Yet Another FAT Sorter) is a multi-platform (Windows and Unix-like systems as Linux and Mac OS X) C/C++ open-source (GPLv3) program that can sort files and directories of a FAT file system (FAT16 and FAT32). It operates directly on FAT file system structure changing the order of its entries. User specifies a file with an arbitrary order as input to the program and it sorts FAT file system entries according to the order provided. It is useful for sound systems (i. e., Mp3 Players, Mp4 Players and car sound systems), digital photo albums and dvd players that read a FAT file system and do not provide a mechanism to change the play list order.

    It also has a GUI called Visual YAFS

  • FAT-32 Sorter. Yes, probably not a GUI but a TUI

    FAT-32 sorter screenshot

  • https://github.com/maxpat78/FATtools

    This is a refinement and extension of my FATtools provided in PyDiskTools on GitHub.

    Born to re-sort in an arbitrary order the directory entries in a FAT32 root table to cope with some hardware MP3 players' limits, it now provides full read/write support in Python 2.7 (32-bit) for FAT12/16/32 and exFAT filesystems, for hacking and recovering purposes.

  • How to reorder the files of a FAT32 file system?

A non-exhausive list of tools is available here: Sort MP3 Files On MP3 Player

2

The program Rosso works with Windows, and can sort FAT32 drives:

$ seq --equal-width 225 | sort --random-sort | xargs mkdir

$ time rosso -d / F:
Sorting directory /

real    0m0.895s

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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