Fenux.Net - The Life of a Geek
Posted on 4/21/2008 4:27 pm in Coding

What is it?

A "simple" program to sort files on a FAT file system. The target scenario for it is to sort the files and folders on a USB flash drive alphabetically, so they are loaded properly on devices that read them.

But why?

I bought a cheap car stereo about a year ago that plays MP3 files from either CD or from a USB flash drive or a compact flash memory card. However, it plays them in the order that they were added to the device.

Sometimes, Windows doesn't copy the files over in the right order, or if files are added at a later date, they stay at the end. When I listen to full albums in the car, it bugs me when they play out of order.

I searched around for a utility to correct the problem, but none of them supported recursion of subfolders. So I decided to make one.

Why it is necessary

The FAT file system doesn't support sorting directory entries. However, this is the only file system for USB flash drives that is widely supported. Unless the hardware or software accessing the device (like your computer) resorts them for display, the files will show in the order they were added to the directory.

How we get around it

To get around the problem, we cheat. By making a temporary directory, moving all the files to it, and then moving them back, in the new order, we effectively resort the directory. We then repeat the process in each directory listed. Sorter does this in reverse order, but not for any reason other than it makes the progress bar more accurate, because it knows how many files are there before it starts.

Why do you say it's a "simple" program

The actual sorting process is fairly straight forward. However, it offered me an excuse to play with technologies I hadn't gotten to use yet, like WPF (Windows Presentation Framework) and threading. I've also added basic support for localization, but as I don't speak any other languages, I haven't made any translations for it. With all that in mind, the program ended up quite a bit more complicated than necessary, but it doesn't hurt anything.

What does it require?

The program requires Windows XP or later and the .NET Framework 3.5. It will allow you to download the framework when you install it, so you don't have to install it beforehand.

Where can I get it?

You can download the file directly here. It also includes (most of) the source code for the program, if you want to take a look. I've released it as open source (see the included license for details).

Post a Comment

Most Recent Comments

Works on a 650GB USB Drive w/subfolders
Works like a champ! Running it to sort files on a 640GB FAT32 Buffalo USB drive on which I have media files. Drive is connected to an OPPO DVD Player (which reads the files in order of writing) - this small app has fixed that problem! Thanks!!
Posted: Jan 15th, 13:37 by Pirate Bob
[No subject]
OMG! Awesome app! Thanks SO much! Makes my USB in-car stereo 100 times better.
Posted: Oct 30th 2011, 10:43 by Anonymous
FAT sorter crashes
Hi, I guess I'm unlucky o judge by the other reviews. I just installed v1.0.4 and it crashes everytime it gets near the end of the sorting process. I have tried deactivating avast antivirus, still no luck. Windows XP Home edition 5.1.2600.
Posted: Sep 4th 2011, 09:47 by Mike
It really does work! Continuation of comment below
After trying the program for a few days, it does work fast and at about 95-98% efficiency. There are a few folders which have more than 170-180 files which require me to run the program again. But all in all it does work great. I just wanted to know, with this type of workaround, would it in anyway damage the HDD or slow it down, or maybe require to de-frag more often?
Posted: Aug 17th 2011, 11:29 by Anand Kagal
Holy ****! It actually worked for me!
Thank you so much! I want to elaborate the use of this nifty program. I have a Phillips DVP3356 to which I connect a 2 TB external HDD with FAT32 and a lot (I mean LOT) of movies and TV episodes. I was able to sort the entire drive in 8.2 mins as shown by the program and it all actually worked. Even a folder with more than 648 files (648 is a problematic figure for most DVD players/FAT32 drives) was sorted correctly. I must say I spent a lot of time searching for a solution but now find it safe to say that this program works on a 2 TB external FAT32 drive with 10000s of videos on it. (Keywords: DVP3356 External HDD file sort)
Posted: Aug 11th 2011, 12:21 by Anand Kagal
fat sorter
great item worked without problems save spending ages looking for a downloaded program and its simple to use even for me who likes programs to work without hassle
Posted: Jul 23rd 2011, 13:16 by jim
buy bulk facebook fans bo
buy facebook likes\nbuy facebook likes cheap\nbuy facebook page likes\n \nbuy facebook likes <a href="http://www.digg-domain-name.info/story.php?id=11413#comments\n">buy facebook likes cheap\n</a> buy targeted facebook likes buy facebook likes \n_________________ \nbuy facebook likes <a href=http://lankasex.com/forum/index.php?action=profile;u=14665>buy likes on facebook</a> buy guaranteed facebook fans buy likes on facebook
Posted: Jul 18th 2011, 05:57 by Demodserne
Thanks.....
thank you very much for this nice utility.....
Posted: Jul 4th 2011, 02:27 by anilkumar
Thankyou, Thankyou, Thankyou!!
I am SO appreciative of your FAT Sorter! You've solved all my problems for playing back avi files. THANKYOU!
Posted: May 23rd 2011, 01:10 by Danielle Daws
Really FAT sorting?
Does the program really sorts files/directories via FAT entries?\n\nWhy I am asking: Found it at http://www.murraymoffatt.com/software-problem-0010.html and the last app listed there "Fat Sorter (sorts alphanumeric, requires .Net 2)" just copies files (so re-creates files) in the sorted order but fur lot of and/or large files that approach will be slow.
Posted: Apr 3rd 2011, 19:17 by Harald&#45;René Flasch
discount watches
ndcrafted work, mirror work, sequin work <b><a href="http://www.cheapwatchesa.com/category-46-b0-Patek+Philippe.html">Patek Philippe watches coaxial</a></b> etc are used to add more elegency to these ladies <b><a href="http://www.cheapwatchesa.com/category-25-b0-Franck+Muller.html">cheap Franck Muller watches watches for sale</a></b> ork, beaded work, totally handcrafted work, mirror work, sequin work <b><a href="http://www.superdesignerhandbag.com/category-5-b0-Burberry.html">Burberry handbags handbags for cheap</a></b> etc are used to add more elegency to these ladies <b><a
Posted: Mar 10th 2011, 04:41 by discount watches
BEST THING EVER!!!
Thanks for making this.. Pioneer needs to hire because almost all their stereos goes by the date music was uploaded and not by alphabet.. Once again... THANK U!!!
Posted: Jan 30th 2011, 00:57 by SLYTLYSCRAMBLED
Thanks
Thank-you so much. I bought a cheap GPX mp3 player I use for my car. It was such a P.I.T.A. organizing the files. Thanks to this awesome program, that's not an issue anymore.
Posted: Nov 18th 2010, 14:28 by John
answer this post
If you want to buy a car, you would have to get the <a href="http://bestfinance-blog.com/topics/credit-loans">credit loans</a>. Moreover, my father usually utilizes a small business loan, which seems to be really reliable.
Posted: Oct 29th 2010, 17:51 by BURT33TABATHA
thanks for making this
I really appreciate your work on this app. My new car has a usb port, which I plug in a portable HD into with my MP3 collection. Unfortunately the device doesn't perform any sorting at all, it seems to list the files in the order they're written to the FAT table.\n\nThis was the only FAT sorting app that worked for me, and it's very fast too.
Posted: Oct 21st 2010, 17:03 by TravisO
Creative Commons License  Subscribe with Bloglines  Get Daily Wisdom!
This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.
© 2000-2012 Jason Burgess