Last active
December 18, 2015 03:39
-
-
Save satojkovic/5719884 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <windows.h> | |
int main() | |
{ | |
WIN32_FIND_DATA FindDirData; | |
std::string targets = "C:\\*"; | |
HANDLE hFind = FindFirstFile(targets.c_str(), &FindDirData); | |
do { | |
if( hFind != INVALID_HANDLE_VALUE ) { | |
if( strcmp(FindDirData.cFileName, ".") && strcmp(FindDirData.cFileName, "..") ) { | |
if( FindDirData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) { | |
std::cout << "Directory: " << FindDirData.cFileName << std::endl; | |
} | |
else { | |
std::cout << "Not Directory: " << FindDirData.cFileName << std::endl; | |
} | |
} | |
} | |
} while( FindNextFile(hFind, &FindDirData) ); | |
FindClose(hFind); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment