#include "PlatformUtils.h" #include "boosty.h" bool PlatformUtils::createLibraryPath() { std::string path = PlatformUtils::libraryPath(); bool OK = false; try { if (!fs::exists(fs::path(path))) { PRINTB("Creating library folder %s", path ); OK = fs::create_directories( path ); } if (!OK) { PRINTB("ERROR: Cannot create %s", path ); } } catch (const fs::filesystem_error& ex) { PRINTB("ERROR: %s",ex.what()); } return OK; } std::string PlatformUtils::libraryPath() { fs::path path; try { path = boosty::canonical(fs::path(PlatformUtils::documentsPath())); if (path.empty()) return ""; path /= "OpenSCAD"; path /= "libraries"; //PRINTB("path size %i",boosty::stringy(path).size()); //PRINTB("Appended path %s", path ); //PRINTB("Exists: %i", fs::exists(path) ); } catch (const fs::filesystem_error& ex) { PRINTB("ERROR: %s",ex.what()); } return boosty::stringy( path ); }