Commit b7b72298 authored by Kilian Lackhove's avatar Kilian Lackhove
Browse files

handle backup on non-shared filesystems

parent 5eaf0277
...@@ -423,8 +423,16 @@ std::string FieldIO::SetUpOutput(const std::string outname, bool perRank, bool b ...@@ -423,8 +423,16 @@ std::string FieldIO::SetUpOutput(const std::string outname, bool perRank, bool b
bakPath += specPath.extension(); bakPath += specPath.extension();
} }
std::cout << "renaming " << specPath << " -> " << bakPath << std::endl; std::cout << "renaming " << specPath << " -> " << bakPath << std::endl;
try
{
fs::rename(specPath, bakPath); fs::rename(specPath, bakPath);
} }
catch (fs::filesystem_error &e)
{
ASSERTL0(e.code().value() == berrc::no_such_file_or_directory,
"Filesystem error: " + string(e.what()));
}
}
// wait until rank 0 has backed up the old specPath // wait until rank 0 has backed up the old specPath
if (backup) if (backup)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment