mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-25 18:50:19 -06:00
Do NOT delete files recursively - causes massive problems if outputdir is not specified..
This commit is contained in:
parent
151bba43a7
commit
683dc715e2
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user