Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com 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
add comment

1 Answer

You can use the Win32 defrag API to move the clusters of a file to a specific location in the volume: http://msdn.microsoft.com/en-us/library/windows/desktop/aa363911%28v=VS.85%29.aspx#defragmenting_a_file

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.