Have some FATness.

A tasty link for the hardware people out there.

It's a freeware FAT12/16/32 filesystem written in ANSI C and optimized for 8 or 16 bit microprocessors with a focus on small memory usage. It won't do long filenames because Microsoft in their infinite wisdom requires a paid license for that (buh?? Dan? WTF?). In its "tiny" configuration, it only uses 544 bytes of RAM plus 28 bytes per open file.

Anyway, you provide low-level routines for some basic media access and configuration operations (read sector, write sector, init disk, etc.) and it does the rest. Writing these routines for something like an SD card is fantastically simple, though it'll also work with CF, HDD, or pretty much any storage medium where FAT makes sense.

The result, for me, is a datalogger that saves sensor data to an on-board SD card, which can then be ripped out and put into a laptop, and the card comes up as a disk with properly-formatted files on it. We've been doing this for awhile, but we've either had to pay a license fee for a closed-source product or put up with some really poorly-optimized solutions that had hideously limiting constraints (e.g. only one file could be open at a time, no file append, no filesystem management options, etc). Now it's free, well-implemented, and small. Yay.