How do I get all entries in root-directory? (FAT32)

K

keandi

How do I get all entries in root-directory? (FAT32)

Hi.
I'm making a program that reads all directories and files HDD.
The HDD's format is FAT32.
(This project's very important thing is to read FAT32 format directly.
So I don't use WIN32 API find-file functions (like FindFirstFile())


I use next DIRECTORYENTRY.


typedef struct _FAT_DIRECTORY_ {
BYTE Name[8];
BYTE Extender[3];
BYTE Attribute;
BYTE NTResource;
BYTE CreateTimeTenth;
WORD CreateTime;
WORD CreateDate;
WORD LastAccessDate;
WORD FirstClusterHigh2B;
WORD WriteTime;
WORD WriteDate;
WORD FirstClusterLow2B;
DWORD FileSize;



}FAT_DIRENTRY_, *LPFDIRENTRY_;


I use next LONGFILENAME

typedef struct _FAT_LONG_DIRECTORY_ {
BYTE Order;
BYTE Name1[10];
BYTE Attribute;
BYTE Type;
BYTE CheckSum;
BYTE Name2[12];
WORD FirstClusterLow;
BYTE Name3[4];



}FAT_LONGDIRENTRY, *LPFLONGDIRENTRY_;


I took two tests.
First, I had 10 files in root-directory.
I could read all files(10).

Second, I had 1000 files in root-directory.
I could read only 129 files.


I thought why I couldn't read all files.
Maybe it is because ........


The size of directory entry's cluster is 8192(16 * 512).
So the size is limited as the size.


Second case I need 5 cluster. (1000 files)
So I need rest cluster.
So.... I searched the way.
But.... I couldn't search the way.




Please help me. Please tell me how I get all entries...
 
T

Tim Slattery

I took two tests.
First, I had 10 files in root-directory.
I could read all files(10).

Second, I had 1000 files in root-directory.
I could read only 129 files.

So what condition are you checking to determine that you've finished
reading all the entries? Clearly something is wrong there. You've
given us no information on that, so there's no way we can help you.

The question really doesn't belong here, it belongs in a programming
group. Most XP installations don't even use FaT32.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top