Skip to content

Instantly share code, notes, and snippets.

@GuillaumeLeclerc
Created August 13, 2015 08:33
Show Gist options
  • Save GuillaumeLeclerc/b41349096e9ac7a9c3fb to your computer and use it in GitHub Desktop.
Save GuillaumeLeclerc/b41349096e9ac7a9c3fb to your computer and use it in GitHub Desktop.
bool fixed_is_directory(std::string path) {
boost::system::error_code errorCode;
bool result = boost::filesystem::is_directory(path, errorCode);
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