From 52936fe58f1b5731cb5c5f6516668868b9ad26f2 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Wed, 27 Mar 2024 17:31:19 -0400 Subject: [PATCH] use std::filesystem::current_path in job_info (#2805) this eliminates a C routine with a buffer Co-authored-by: Eric T. Johnson --- Source/driver/Castro_io.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/driver/Castro_io.cpp b/Source/driver/Castro_io.cpp index e66a8b5ac9..9b08cc95a3 100644 --- a/Source/driver/Castro_io.cpp +++ b/Source/driver/Castro_io.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -578,10 +579,7 @@ Castro::writeJobInfo (const std::string& dir, const Real io_time) jobInfoFile << "output date / time: " << std::put_time(std::localtime(&now), "%c\n") << "\n"; - char currentDir[FILENAME_MAX]; - if (getcwd(currentDir, FILENAME_MAX) != nullptr) { - jobInfoFile << "output dir: " << currentDir << "\n"; - } + jobInfoFile << "output dir: " << std::filesystem::current_path() << "\n"; jobInfoFile << "I/O time (s): " << io_time << "\n";