# # # patch "sanity.cc" # from [00973120f9cecede882c32d5e88e1c20bdcaafd0] # to [037dbbf47c45e082f21ef1ab46401721f474037b] # ============================================================ --- sanity.cc 00973120f9cecede882c32d5e88e1c20bdcaafd0 +++ sanity.cc 037dbbf47c45e082f21ef1ab46401721f474037b @@ -20,6 +20,7 @@ #include "lexical_cast.hh" #include "constants.hh" #include "platform.hh" +#include "file_io.hh" // make_dir_for #include "sanity.hh" #include "simplestring_xform.hh" @@ -156,6 +157,19 @@ sanity::dump_buffer() if (!imp->filename.empty()) { ofstream out(imp->filename.c_str()); + if (!out) + { + try + { + make_dir_for(system_path(imp->filename, origin::internal)); + out.open(imp->filename.c_str()); + } + catch (...) + { + inform_message((FL("failed to create directory for %s") + % imp->filename).str()); + } + } if (out) { copy(imp->logbuf.begin(), imp->logbuf.end(),