Hi, I am trying to edit the raw data of a FAT drive (I think I found a solution for NTFS, but didn't work for FAT. I don't have anything with FAT, just all my devices are using it) with C# (the result should be a drive in a different format - my own format). I was able to read the raw data (was nice seeing the FAT from inside) from it using CreateFile and opening a stream using the IntPtr I got, but couldn't write to it. I tried several computers, USB flash drives, SD cards, floppy disks - nothing. If it isn't possible with C#, I can do it with another language and later call the function using DLLImport. Thanks.
A:
If you edit/modify the drive on the sector level it could be no longer be fully compatible.
The standard way is to make a big file to fill al the space and then operate on those sectors.
Since your goal is space FAT is actually not efficient. If you control both ends ( read/write) you can just cange sector 0 so that is is not recogninzed as an existing file system and then you can wirte your own sectors. Windows would nag you at insertion that the drive is not formatted.
Dominik Weber
2010-08-23 20:13:39