1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 02:12:45 +01:00

unique_path doesn't exist in std::filesystem

This commit is contained in:
tsjost 2021-10-12 16:50:19 +02:00
parent bf345af47a
commit 26983ffa3d

View File

@ -7,6 +7,7 @@
#include <fstream>
#include <map>
#include <chrono>
#include <rw/debug.hpp>
#include <rw/filesystem.hpp>
@ -92,7 +93,8 @@ protected:
private:
static rwfs::path getRandomFilePath(const rwfs::path &dirname) {
return rwfs::unique_path(dirname / "openrw_test_%%%%%%%%%%%%%%%%");
const long current_time = std::chrono::high_resolution_clock::now().time_since_epoch().count();
return dirname / ("openrw_test_" + std::to_string(current_time));
}
static rwfs::path getRandomFilePath() {
return getRandomFilePath(rwfs::temp_directory_path());