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
@@ -21,6 +21,7 @@
#include "WriteTemplateFile.hpp"
#include <fstream>
#include <stdexcept>
#include "ofstream_synced.hpp"
using namespace pipedal;
@@ -37,7 +38,7 @@ void pipedal::WriteTemplateFile(
const std::filesystem::path &inputFile,
const std::filesystem::path &outputFile)
{
std::ofstream out(outputFile);
pipedal::ofstream_synced out(outputFile);
std::ifstream in(inputFile);
if (!in.is_open())