From 683dc715e29b584da6f88083acc7003ec6a821b6 Mon Sep 17 00:00:00 2001 From: Vegard Kippe Date: Fri, 14 Jun 2024 13:36:15 +0200 Subject: [PATCH] Do NOT delete files recursively - causes massive problems if outputdir is not specified.. --- opm/simulators/utils/readDeck.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/simulators/utils/readDeck.cpp b/opm/simulators/utils/readDeck.cpp index 6d14d0c04..bdf7a8971 100644 --- a/opm/simulators/utils/readDeck.cpp +++ b/opm/simulators/utils/readDeck.cpp @@ -407,7 +407,7 @@ void Opm::prepareResultOutputDirectory(const std::string& baseName, { //Loop over all files in the output directory and subdirectories and delete them if their name is baseName + a correct extension std::regex r(baseName + R"(\.(F?(DBG|E?GRID|INIT|PRT|RFT|SMSPEC|UNSMRY|UNRST)|([ABCFGHSTUXYZ]\d{4})|(INFOSTEP|INFOITER|OPMRST)))"); - for (auto& file : std::filesystem::recursive_directory_iterator(outputDir)) { + for (auto& file : std::filesystem::directory_iterator(outputDir)) { std::string fileName = file.path().filename(); if (std::regex_match(fileName, r)) { std::filesystem::remove(file);