const boost::filesystem::path& GetDataPath() { static boost::filesystem::path path; path = GetDefaultDataPath(); if (!boost::filesystem::exists(path)) { // Create data directory if (!boost::filesystem::create_directory(path)) { LogPrint(eLogError, "Filesystem: failed to create data directory!"); path = ""; return path; } } if (!boost::filesystem::is_directory(path)) path = GetDefaultDataPath(); return path; }
const bfs::path& GetDataPath() { static bfs::path path; path = GetDefaultDataPath(); if (!exists(path)) { // Create data directory if (!create_directory(path)) { LogPrint("Failed to create data directory!"); path = ""; return path; } } if (!is_directory(path)) path = GetDefaultDataPath(); return path; }