Original Post
I'm trying to scan Windows Directories in a console program. But, it's not working. It finds all the files in the directory. However, there is the following text that shouldn't be there:(The following is the whole output)(The problem is those periods. It thinks those are files when they aren't.) [Edited by - yellowstar on March 7, 2008 9:55:27 PM]
Quote:
Searching for files... . .. main.cpp palfix.dev Makefile.win main.o palfix.exe Done! Press any key to continue . . .
int main(int argc, char *argv[])
{
WIN32_FIND_DATA dat;
HANDLE search;
printf("Searching for files...\n");
search=FindFirstFile("*.*",&dat);
if(search==INVALID_HANDLE_VALUE || ERROR_NO_MORE_FILES==GetLastError())
{
printf("Error: %s\n",GetLastError());
}
printf("%s\n",dat.cFileName);
while(FindNextFile(search,&dat))
{
printf("%s\n",dat.cFileName);
}
FindClose(search);
printf("Done!\n");
system("PAUSE");
return EXIT_SUCCESS;
}