add copyFile() & copyFileContent() for POSIX env

This commit is contained in:
guoling
2021-09-15 20:45:29 +08:00
parent 720b172b0b
commit 89cd549a88
4 changed files with 98 additions and 7 deletions
+2 -1
View File
@@ -110,9 +110,10 @@ bool copyFileContent(const MMKVPath_t &srcPath, const MMKVPath_t &dstPath) {
auto ret = copyFileContent(srcPath, dstFD);
if (!ret) {
MMKVError("fail to copyfile(): target file %s", dstPath.c_str());
} else {
MMKVInfo("copy content from %s to fd[%s] finish", srcPath.c_str(), dstPath.c_str());
}
::close(dstFD);
MMKVInfo("copy content from %s to fd[%s] finish", srcPath.c_str(), dstPath.c_str());
return ret;
}