Domanda

We are building a fat32 filesystem manipulation tool in C and are currently trying to access all the entries in the root directory (situated right after the two FAT tables).

The first question is : Are all the root directory entries contiguous in the data region ? If not, given the first entry, how can we access the next entry ?

Does it have anything to do with the tags "low cluster / high cluster" or do we need to look in the FAT table for it (root directory) ?

Basically, we have the "equation" that leads us to the data region. Based on that, we point on the cluster, but after that, we don't really know how to find the next entry in the Root Directory.

This might seem confusing, but if you need pieces of code or more information, I will provide them.

Thank you in advance.

È stato utile?

Soluzione

FAT (also FAT32) directory entries are 32bytes and appear in a sequential order.

To store long file names an entry could need multiples of 32 bytes.

About how L(ong)F(ile)N(ames) are marked (from wikipedia):

Long File Names (LFN) are stored on a FAT file system using a trick—adding (possibly multiple) additional entries into the directory before the normal file entry. The additional entries are marked with the Volume Label, System, Hidden, and Read Only attributes (yielding 0x0F), which is a combination that is not expected in the MS-DOS environment, and therefore ignored by MS-DOS programs and third-party utilities. (ff)


Referring your second question (from wikepedia):

[...] VFAT LFN entries always have the cluster value at 0x1A set to 0x0000 and the length entry at 0x1C is never 0x00000000 [...]

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top