From: SourceForge.net <no...@so...> - 2004-03-26 09:33:10
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=2493308 By: jirisarri Hello, I am using Dev-C++ 4.9.8.0 with gcc 3.2 (20020817-1). I'm trying read a directory with FindFirstFile and FindNextFile but this function always return 0 and GetLastError() return ERROR_NO_MORE_FILES. FindFirstFile is OK (return the first file). I have probe con directories as "*.*", "c:/" "c:/*.*", "*",... The source (similar to examples in MSDN Library) is: void LeerDirectorio (LPCTSTR s) { HANDLE hdir; WIN32_FIND_DATA xdata; hdir = FindFirstFile( s, /*LPCTSTR lpFileName,*/ &xdata /*LPWIN32_FIND_DATA lpFindFileData*/ ); if (hdir == INVALID_HANDLE_VALUE) { printf ("Invalid File Handle.\n"); vererror(); return; } for(;;) { printf("Fic: %s\n",xdata.cFileName); if(FindNextFile( hdir, &xdata)==0) { if(GetLastError()!=ERROR_NO_MORE_FILES) vererror(); break; } } FindClose(hdir); } ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=286641 |