Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a system that write files to a FAT32 partition but it frequently write the wrong starting cluster number for some files. I would like a software that is easy to use so I can just find the file in the root directory table and update that file's starting cluster number. If it is in command line mode it is more easy to use too . Is there such a software or how I can do that?

share|improve this question

migrated from Mar 21 '12 at 23:42

This question came from our site for professional and enthusiast programmers.

All these files are in the root directory of the partition. So we do not need go deep into the many sub-folders and files. – Au Kevin Oct 4 '11 at 2:49

You can use the Win32 defrag API to move the clusters of a file to a specific location in the volume:

Note that for very small files (less than 1KB) the file may not occupy any clusters at all because it is stored in the file's page in the file table.

share|improve this answer
Hi, Thanks but I think this is not what I want. The file data has been written to the partition as well as the file. But the file's starting cluster number in the root directory table is wrong. It points to the wrong location. What I want is to update that file's starting cluster number to point to the correct location. Simply put, it is to read and update some information in the root directory table. – Au Kevin Oct 4 '11 at 2:45
Are you implementing a FAT32 driver or using a broken one? If the directory table is wrong, how do you know where the file is? – Eric Nicholson Oct 4 '11 at 13:50
Actually the file, or more correctly, the file's root directory table information is wrong. – Au Kevin Oct 5 '11 at 7:25

You must log in to answer this question.