Skip to content

Instantly share code, notes, and snippets.

@huoxudong125
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huoxudong125/57a4bc8fdc5a7e931659 to your computer and use it in GitHub Desktop.
Save huoxudong125/57a4bc8fdc5a7e931659 to your computer and use it in GitHub Desktop.
bool IsExistDirectory(const std::wstring& dirName_in)
{
DWORD ftyp = GetFileAttributes(dirName_in.c_str());
if (ftyp == INVALID_FILE_ATTRIBUTES)
return false; //something is wrong with your path!
if (ftyp & FILE_ATTRIBUTE_DIRECTORY)
return true; // this is a directory!
return false; // this is not a directory!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment