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,11 +328,13 @@ namespace Opm
|
|||||||
output_dir_ =
|
output_dir_ =
|
||||||
param_.getDefault("output_dir", std::string("."));
|
param_.getDefault("output_dir", std::string("."));
|
||||||
boost::filesystem::path fpath(output_dir_);
|
boost::filesystem::path fpath(output_dir_);
|
||||||
try {
|
if (!is_directory(fpath)) {
|
||||||
create_directories(fpath);
|
try {
|
||||||
}
|
create_directories(fpath);
|
||||||
catch (...) {
|
}
|
||||||
OPM_THROW(std::runtime_error, "Creating directories failed: " << fpath);
|
catch (...) {
|
||||||
|
OPM_THROW(std::runtime_error, "Creating directories failed: " << fpath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Write simulation parameters.
|
// Write simulation parameters.
|
||||||
param_.writeParam(output_dir_ + "/simulation.param");
|
param_.writeParam(output_dir_ + "/simulation.param");
|
||||||
|
|||||||
Reference in New Issue
Block a user