How do I get all files in any directory?
Hello everyone.
Now I'm posting a FAT32 partition reading program.
Any directory have 512 files.
See next codes:
------------------------------------------------------------------------------------------------------------
for (nLoop = 0; nLoop <= dwSectorPerCluster*16; nLoop++)
{
if (lpDirEntry[nLoop].Name[0] == 0x00) break;
if (lpDirEntry[nLoop].Name[0] == 0xE5) continue;
if (lpDirEntry[nLoop].Attribute == 0x0F)
{
dwLongEntryEn = 1;
continue;
}
memset(szFileName, 0x00, sizeof(szFileName));
memset(szTmp, 0x00, sizeof(szTmp));
if (dwLongEntryEn == 1)
{
m_FAT32.ToLongFileName((LPFATLONGDIRENT_)lpDirEntry, nLoop - 1,
szParentDir,
szFileName, sizeof(szFileName) / sizeof(TCHAR));
dwLongEntryEn = 0;
}
else
{.......... any codes..}
--------------------------------------------------------------------------------------
First, the FOR statment's nLoop is 511 at last. I think the for-count
is right. But in looping long-file-name files get 'continue'. So real
count is 255.
You know, the directory have 512 files.
Last file name is 'MZ'. 'MZ' is not file in Explorer. So I guess the
'MZ' point any information. (just guess).
Could you help me?