From 18aae7b32b061dc1491b35707290c62fcecd1ec8 Mon Sep 17 00:00:00 2001 From: chenkeyu Date: Mon, 9 Sep 2024 12:12:10 +0800 Subject: [PATCH] add flush after write Issue: https://gitee.com/openharmony/commonlibrary_c_utils/issues/IAPVNB?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