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,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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user