sync() after write to avoid losing file data on power off.

This commit is contained in:
Robin Davies
2024-09-01 09:53:32 -04:00
parent abb8a1a53c
commit b8c4fafd3a
21 changed files with 102 additions and 34 deletions
+2 -1
View File
@@ -22,6 +22,7 @@
#include <fstream>
#include "Lv2Log.hpp"
#include "ss.hpp"
#include "ofstream_synced.hpp"
@@ -40,7 +41,7 @@ void UpdateResults::Load()
}
void UpdateResults::Save()
{
std::ofstream f {UPDATE_RESULT_PATH};
pipedal::ofstream_synced f {UPDATE_RESULT_PATH};
if (f.is_open())
{
json_writer writer(f);