Last active
May 7, 2020 03:41
-
-
Save moebiussurfing/4d3901731ab7c40cc2f3edc4e0eb5ef6 to your computer and use it in GitHub Desktop.
openFrameworks / check if a data folder is present, create the folder if not.
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
void ofApp::CheckFolder(string _path) | |
{ | |
ofDirectory dataDirectory(ofToDataPath(_path, true)); | |
//check if target data folder exist | |
if (!dataDirectory.isDirectory()) | |
{ | |
ofLogError("__FUNCTION__") << "FOLDER DOES NOT EXIST!"; | |
//create folder | |
bool b = dataDirectory.createDirectory(ofToDataPath(_path, true)); | |
//debug if creation has been succed | |
if (b) | |
ofLogNotice("__FUNCTION__") << "FOLDER '" << _path << "' CREATED SUCCESSFULLY!"; | |
else | |
ofLogError("__FUNCTION__") << "UNABLE TO CREATE '" << _path << "' FOLDER!"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment