From 79a891af0571147be2b62971d8f5cb93115f516b Mon Sep 17 00:00:00 2001 From: chenkeyu Date: Thu, 29 Aug 2024 20:36:59 +0800 Subject: [PATCH] Add flush to SaveBufferToFile make sure write to disk Issue:https://gitee.com/openharmony/commonlibrary_c_utils/issues/IANH2E?from=project-issue Signed-off-by: chenkeyu --- base/src/file_ex.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/base/src/file_ex.cpp b/base/src/file_ex.cpp index 897cc41..7ad317c 100644 --- a/base/src/file_ex.cpp +++ b/base/src/file_ex.cpp @@ -345,6 +345,7 @@ bool SaveBufferToFile(const string& filePath, const vector& content, bool } file.write(&content[0], content.size()); + file.flush(); return true; } -- Gitee