Пример #1
0
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;
}
Пример #2
0
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;
}