mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #683 from atgeirr/check-dir-exists
Check if dir already exists before creating.
This commit is contained in:
commit
d3192028b6
@ -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");
|
||||||
|
Loading…
Reference in New Issue
Block a user