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?
migrated from stackoverflow.com Mar 21 '12 at 23:42
This question came from our site for professional and enthusiast programmers.
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.