1
0
Fork 0

src/Aircraft/replay.cxx: try to ensure parent dir of recovery tape.

Avoids unexpected absence of a recovery tape.
This commit is contained in:
Julian Smith 2020-09-07 16:15:41 +01:00
parent 270cada516
commit bdfd42ebd4

View file

@ -988,6 +988,7 @@ FGReplay::update( double dt )
// guarantee that there is always a valid recovery tape even if // guarantee that there is always a valid recovery tape even if
// flightgear crashes or is killed while we are writing. // flightgear crashes or is killed while we are writing.
// //
path.create_dir();
(void) remove(path_temp.c_str()); (void) remove(path_temp.c_str());
std::ofstream out; std::ofstream out;
bool ok = true; bool ok = true;
@ -998,7 +999,8 @@ FGReplay::update( double dt )
rename(path_temp.c_str(), path.c_str()); rename(path_temp.c_str(), path.c_str());
} }
else { else {
popupTip("Failed to update recovery file", 2 /*delay*/); std::string message = "Failed to update recovery file: " + path.str();
popupTip(message.c_str(), 3 /*delay*/);
} }
} }
} }