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 (GPL3) 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.


FAQ (Frequently Asked Questions)

Release notes


During all the process, the device must not be changed by other program (on Unix-like systems the device must not be mounted). You will also need administrator/superuser permission to read and write the device driver that will be changed.

First, it is necessary to read the current file system directory tree. Enter in YAFS folder (or add YAFS folder to the PATH variable) and execute the following command (on Windows use the command prompt): yafs -d J: -f file_system_directory_tree.xml -r. The "-d" parameter selects the FAT device that will be handled, in our example it is "J:". The "-f" is used to provide the input/output file. The last parameter ("-r") informs the program that it must export the current file system directory tree.

This figure shows the XML file generated by YAFS representing the file system directory tree after the execution of previous command. The root has four entries. "Folder1" and "Folder2" are directories. "File1" and "File2" are files. The attribute order represents the current disposal of the entries in the file system structure. They are numerate in intervals of 100 to facilitate the reordering.

YAFS will create a XML file containing the device directory tree. User will change attribute order to specify the new arrangement. The valid values are positive integer numbers (they do not need to be consecutive). The FAT entries will be sorted (in increasing order) following the numbers specified in order attribute. The XML file must be changed with an editor that supports UTF-8 encoding (Notepad++, for example).

This figure shows an edited version of XML file presented in the previous figure. The order attributes were changed. After the execution of the command yafs -d J: -f file_system_directory_tree.xml -w, the entries arrangement on file system structure will be "File1", "Folder1" ("File3" and "File4"), "Folder2" and "File2". To insert the entries "Folder1" and "Folder2" immediately after "File1" we have just changed their order attributes to 301 and 302, respectively.

After edit the file to change order attributes, the command yafs -d J: -f file_system_directory_tree.xml -w must be executed. The program now will sort the device entries (files and directories) following the arrangement specified in the input file. For more information, use the command yafs -h.