# Paths in OpenFrameworks.

I have my own library that will return files matching a condition on a directory, but it returns them on the native form (in Windows, C:\foo\bar). This isn’t allowed by ofToDataPath, so I modified it like this. Does this make sense? How are absolute paths supposed to be given (I can change \ for /, but what about the drive letters?)


string ofToDataPath(string path){
#ifdef TARGET_OSX
if(path.substr(0,1) != "/" && path.substr(0,14) != "../../../data/") path = "../../../data/"+path;
#else
if(path.substr(1,2) != ":" && path.substr(0,1) != "/" && path.substr(0,5) != "data/") path = "data/"+path;
#endif
return path;
}



I added path.substr(1,2) != “:” as a hint that it’s a drive letter and thus take it as absolute path, that may have to go in a TARGET_WIN or equivalent. But I guess there is a proper way which does not involve changing this function. Is there?