]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Check that we successfully created a directory.
authorDavid Wells <wellsd2@rpi.edu>
Thu, 16 Mar 2017 22:22:39 +0000 (18:22 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Sat, 18 Mar 2017 21:22:02 +0000 (17:22 -0400)
examples/step-42/step-42.cc

index a2380228593e92bd370f9e31d1591268e6ac5ee0..33220e4dae2a23c8f1bc476a6d7a9f591dc992c5 100644 (file)
@@ -876,7 +876,8 @@ namespace Step42
     output_dir = prm.get("output directory");
     if (output_dir != "" && *(output_dir.rbegin()) != '/')
       output_dir += "/";
-    mkdir(output_dir.c_str(), 0777);
+    const int ierr = mkdir(output_dir.c_str(), 0777);
+    AssertThrow(ierr == 0, ExcIO());
 
     pcout << "    Using output directory '" << output_dir << "'" << std::endl;
     pcout << "    FE degree " << fe_degree << std::endl;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.