mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Check if dir already exists before creating.
May be necessary on some platforms for the current dir (".").
This commit is contained in:
@@ -328,12 +328,14 @@ namespace Opm
|
||||
output_dir_ =
|
||||
param_.getDefault("output_dir", std::string("."));
|
||||
boost::filesystem::path fpath(output_dir_);
|
||||
if (!is_directory(fpath)) {
|
||||
try {
|
||||
create_directories(fpath);
|
||||
}
|
||||
catch (...) {
|
||||
OPM_THROW(std::runtime_error, "Creating directories failed: " << fpath);
|
||||
}
|
||||
}
|
||||
// Write simulation parameters.
|
||||
param_.writeParam(output_dir_ + "/simulation.param");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user