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

Function tryAtomicRename

Core/MemoryFile.cpp:513–519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

511#if !defined(MMKV_ANDROID) && !defined(MMKV_LINUX)
512
513bool tryAtomicRename(const MMKVPath_t &srcPath, const MMKVPath_t &dstPath) {
514 if (::rename(srcPath.c_str(), dstPath.c_str()) != 0) {
515 MMKVError("fail to rename [%s] to [%s], %d(%s)", srcPath.c_str(), dstPath.c_str(), errno, strerror(errno));
516 return false;
517 }
518 return true;
519}
520
521bool copyFileContent(const MMKVPath_t &srcPath, MMKVFileHandle_t dstFD, bool needTruncate) {
522 if (dstFD < 0) {

Callers 3

tryMigrateLegacyMMKVFileFunction · 0.70
deleteOrRenameFileFunction · 0.70
copyFileFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected