我在订购方面遇到了麻烦。我的代码段工作正常但是,我无法列出所有文件,然后列出所有目录。我已经坚持了几天,经历了不同的想法,并没有走得太远。谢谢你们!
do
{
// DIR serach
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
_tprintf(_T("%s <DIR>\n"), ffd.cFileName);
//else file search
else
{
fileSize.LowPart = ffd.nFileSizeLow;
fileSize.HighPart = ffd.nFileSizeHigh;
_tprintf(_T("%s %ld\n"), ffd.cFileName, fileSize.QuadPart);
}
// continue the search until no files
} while (FindNextFile(hFind, &ffd) != 0);