Last active
August 29, 2015 14:27
-
-
Save GuillaumeLeclerc/447bf65199b152ece16d to your computer and use it in GitHub Desktop.
Workarround for this issue : https://github.com/kripken/emscripten/issues/3675
This file contains hidden or 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
bool fixed_is_directory(std::string path) { | |
boost::system::error_code errorCode; | |
bool result = boost::filesystem::is_directory(path, errorCode); | |
if (errorCode.value() == 2) {//not found | |
return false; | |
} else if (errorCode.value() != 0) { | |
//this second call will fire the correct exception | |
boost::filesystem::is_directory(path); | |
} else { | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment