Skip to content

Commit

Permalink
use std::filesystem::current_path in job_info (#2805)
Browse files Browse the repository at this point in the history
this eliminates a C routine with a buffer

Co-authored-by: Eric T. Johnson <yut23@users.noreply.github.com>
  • Loading branch information
zingale and yut23 authored Mar 27, 2024
1 parent 931e173 commit 52936fe
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Source/driver/Castro_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <iostream>
#include <string>
#include <ctime>
#include <filesystem>

#include <AMReX_Utility.H>
#include <Castro.H>
Expand Down Expand Up @@ -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";

Expand Down

0 comments on commit 52936fe

Please sign in to comment.