Sep 30, 2013 at 7:10pm UTC
¿so what does that snip do?
Oct 1, 2013 at 11:03am UTC
Actually the whole program looks like below, and i will like to use it on ubuntu, but ubuntu doesnt recognise the lines above.
using namespace std;
path = opendir( dirpath.c_str() );
string searchPattern = "*.epol";
string fullSearchPath = path + searchPattern;
hFind = FindFirstFile( fullSearchPath.c_str(), &FindData );
if( hFind == INVALID_HANDLE_VALUE )
cout << "Error searching directory\n";
string filePath = path + FindData.cFileName;
ifstream in( filePath.c_str() );
if( in )
// do stuff with the file here
cout << "Problem opening file " << FindData.cFileName << "\n";
while( FindNextFile(hFind, &FindData) > 0 );
if( GetLastError() != ERROR_NO_MORE_FILES )
cout << "Something went wrong during searching\n";
Oct 1, 2013 at 11:16am UTC
I have read that already, thanks alot. But the problem i have now is that i want my program to search for the files with ".epol" ending and open it. I am a "noob" in C++, so please go easy on me ... ;-)
Oct 1, 2013 at 3:40pm UTC
You should do filename checks on your own.
It's not that hard.