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...
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...