diff --git a/opm/autodiff/FlowMainEbos.hpp b/opm/autodiff/FlowMainEbos.hpp index ddce566a7..04fdaee66 100755 --- a/opm/autodiff/FlowMainEbos.hpp +++ b/opm/autodiff/FlowMainEbos.hpp @@ -326,8 +326,16 @@ namespace Opm std::ostringstream debugFileStream; std::ostringstream logFileStream; - // Strip extension if any - baseName = boost::to_upper_copy(path(fpath.stem()).string()); + // Strip extension "." or ".DATA" + std::string extension = boost::to_upper_copy(fpath.extension().string()); + if ( extension == ".DATA" || extension == "." ) + { + baseName = boost::to_upper_copy(fpath.stem().string()); + } + else + { + baseName = boost::to_upper_copy(fpath.filename().string()); + } const std::string& output_dir = eclState().getIOConfig().getOutputDir(); logFileStream << output_dir << "/" << baseName; @@ -427,7 +435,17 @@ namespace Opm const std::string& output_dir = eclState().getIOConfig().getOutputDir(); fs::path output_path(output_dir); fs::path deck_filename(EWOMS_GET_PARAM(TypeTag, std::string, EclDeckFileName)); - std::string basename = boost::to_upper_copy(fs::path(deck_filename).stem().string()); + std::string basename; + // Strip extension "." and ".DATA" + std::string extension = boost::to_upper_copy(deck_filename.extension().string()); + if ( extension == ".DATA" || extension == "." ) + { + basename = boost::to_upper_copy(deck_filename.stem().string()); + } + else + { + basename = boost::to_upper_copy(deck_filename.filename().string()); + } std::for_each(fs::directory_iterator(output_path), fs::directory_iterator(), detail::ParallelFileMerger(output_path, basename,