Fixes bug when nested directories are created; eg: out/pmc_1 (#345)

* Fixes bug when nested directories are created; eg: out/pmc_1

* source formatting (clang-format v11) (#346)

Co-authored-by: bgopesh <bgopesh@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bgopesh <bgopesh@users.noreply.github.com>
This commit is contained in:
Gopesh Bhardwaj
2024-01-09 23:49:00 +05:30
committed by GitHub
parent 936816f762
commit 55918b5c1f
+1 -1
View File
@@ -62,7 +62,7 @@ get_output_stream(const std::string& fname, const std::string& ext = ".csv")
throw std::runtime_error{
fmt::format("ROCPROFILER_OUTPUT_PATH ({}) already exists and is not a directory",
output_path.string())};
if(!fs::exists(output_path)) fs::create_directory(output_path);
if(!fs::exists(output_path)) fs::create_directories(output_path);
auto output_file = output_path / (output_file_name + fname + ext);
auto* _ofs = new std::ofstream{output_file};