mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -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
|
//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)))");
|
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();
|
std::string fileName = file.path().filename();
|
||||||
if (std::regex_match(fileName, r)) {
|
if (std::regex_match(fileName, r)) {
|
||||||
std::filesystem::remove(file);
|
std::filesystem::remove(file);
|
||||||
|
Loading…
Reference in New Issue
Block a user