openFrameworks icon indicating copy to clipboard operation
openFrameworks copied to clipboard

DoesDirectoryExist can crash the app

Open Taprik opened this issue 10 years ago • 1 comments

I'm experiencing crash when I call the doesDirectoryExist function. The path searched does not exist and the app crash. The setup : windows7, OF 0.9.3. It's not crashing the app with windows 10. The solution is to use this version of doesDirectoryExist bool ofDirectory::doesDirectoryExist(const std::string& _dirPath, bool bRelativeToData){ std::string dirPath = _dirPath; try { if (bRelativeToData) { dirPath = ofToDataPath(dirPath); } return std::filesystem::exists(dirPath) && std::filesystem::is_directory(dirPath); } catch (std::exception & except) { ofLogError("ofDirectory") << "doesDirectoryExist(): couldn't find directory \"" << dirPath << "\": " << except.what()<<endl; return false; } }

Taprik avatar Oct 18 '16 07:10 Taprik

closed by https://github.com/openframeworks/openFrameworks/issues/5315

dimitre avatar Mar 23 '23 02:03 dimitre