MCPcopy Create free account
hub / github.com/Tencent/MMKV / copyFileContent

Function copyFileContent

Core/MemoryFile_OSX.cpp:112–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112bool copyFileContent(const MMKVPath_t &srcPath, const MMKVPath_t &dstPath) {
113 File dstFile(dstPath, OpenFlag::WriteOnly | OpenFlag::Create | OpenFlag::Truncate);
114 if (!dstFile.isFileValid()) {
115 return false;
116 }
117 if (copyFileContent(srcPath, dstFile.getFd())) {
118 MMKVInfo("copy content from %s to fd[%s] finish", srcPath.c_str(), dstPath.c_str());
119 return true;
120 }
121 MMKVError("fail to copyfile(): target file %s", dstPath.c_str());
122 return false;
123}
124
125bool copyFileContent(const MMKVPath_t &srcPath, MMKVFileHandle_t dstFD) {
126 if (dstFD < 0) {

Callers 1

copyFileFunction · 0.70

Calls 2

isFileValidMethod · 0.45
getFdMethod · 0.45

Tested by

no test coverage detected