mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use ensureDirectoryExists() instead of boost::filesystem directly.
Motivated by - proliferation of identical code - need to avoid strange behaviour with "." directory on some boost versions - potenial for further refactoring to avoid boost entirely
This commit is contained in:
@@ -70,6 +70,8 @@
|
||||
#include <opm/parser/eclipse/EclipseState/checkDeck.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
|
||||
#include <opm/simulators/ensureDirectoryExists.hpp>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
@@ -128,14 +130,7 @@ try
|
||||
// Create output directory if needed.
|
||||
output_dir =
|
||||
param.getDefault("output_dir", std::string("output"));
|
||||
boost::filesystem::path fpath(output_dir);
|
||||
try {
|
||||
create_directories(fpath);
|
||||
}
|
||||
catch (...) {
|
||||
std::cerr << "Creating directories failed: " << fpath << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
ensureDirectoryExists(output_dir);
|
||||
// Write simulation parameters.
|
||||
param.writeParam(output_dir + "/simulation.param");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user