36inline std::string
temp_file_path(
const std::string& prefix,
const std::string& ext) {
37 auto path = fs::temp_directory_path();
43 std::random_device rd;
46 auto now = std::chrono::system_clock::now();
47 seed = std::chrono::duration_cast<std::chrono::seconds>(now.time_since_epoch()).count();
50 std::mt19937_64 rng(seed);
53 copy += std::to_string(rng());
56 if (!fs::exists(copy)) {
57 path = std::move(copy);
65 std::ofstream dummy(path, std::ofstream::out);