Archived

This topic is now archived and is closed to further replies.

AcoGL

FAT thanks [answered]

Recommended Posts

AcoGL    122
Does anybody know how FAT (File Allocation Table) work? How does this data structure work? I have created an image of the diskete and I have got to read this diskete's FAT (FAT12). Can anybody tell me how is the FAT stored? Do you have any good documentation? I am interested int FAT, neither boot sector nor directory entries. Thanks a lot. [edited by - AcoGL on January 19, 2004 8:18:19 AM] [edited by - AcoGL on January 19, 2004 8:19:53 AM]

Share this post


Link to post
Share on other sites
AcoGL    122
Thanks, but I am interested in C++ programming. I would like to look for some documentation.

I just don''t understand the numbers in fat sectors - Why are they stored the way they are stored?

Share this post


Link to post
Share on other sites
Leathrewulfe    122
In simple terms, you get the data section location from the boot sector. Then you iterate through all the FAT clusters (directories and files are both considered "files"). If the files are fragmented then the current cluster will point to the next cluster in the chain. It will continue to do this until you reach the EOC marker. The first byte in the short name of a file denotes if it is marked for deletion or not. I think the char is 0xe5 (not sure offhand). If the files is "deleted" you will have to see if its data clusters have been written over already or not. If they haven't, you can alter the 0xe5 character and recover the deleted file.

That is FAT12 in a nutshell, FAT32 has some other idiosyncracies, but is similiar (i.e. almost the same data structures). The FAT specification is your best bet for information (you should be able to find a link to it on MSDN)




"Wisdom is proportionate to your reference base. Intelligence is the ability to appropriately use that Wisdom."


[edited by - leathrewulfe on January 18, 2004 5:32:21 PM]

Share this post


Link to post
Share on other sites
prh99    520
quote:
Original post by AcoGL
Does anybody know how FAT (File Allocation Table) work? How does this data structure work? I have created an image of the diskete and I have got to read this diskete''s FAT (FAT12).

Can anybody tell me how is the FAT stored? Do you have any good documentation?

I am interested int FAT, neither boot sector nor directory entries.

Thanks a lot.



You can try the Operating System resource center

Share this post


Link to post
Share on other sites