From: David Masover Date: 2010-07-25T06:42:45+09:00 Subject: Re: Editing a FAT/FAT32 Partition Table On Tuesday, July 20, 2010 01:26:28 pm Joseph E. Savard wrote: > Not sure I can committ to Ruby being limited in this area. Just know how > to do it in C/c++ from my experience.. > > Take a look here http://ruby-doc.org/core/classes/IO.html. Does not seem > to hit the "DIRECTORY" (FAT) structure... Doesn't seem like it could, really. I don't know of any filesystem API which would make this clean. One possible hack would be to move the files all to a temporary directory on the same device, then move them back, one at a time, syncing after each move. That might force the directory order, but it might wear your SD card a bit, and I don't know enough about FAT to know whether it'd do what you're asking. If that doesn't work, you're going to need some sort of low-level access (/dev/whatever on Unix) and a lot of binary manipulation (or a library). I don't know that there's anything for Ruby -- maybe this in JRuby: http://code.google.com/p/fat32-lib/