| 511 | #if !defined(MMKV_ANDROID) && !defined(MMKV_LINUX) |
| 512 | |
| 513 | bool 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 | |
| 521 | bool copyFileContent(const MMKVPath_t &srcPath, MMKVFileHandle_t dstFD, bool needTruncate) { |
| 522 | if (dstFD < 0) { |
no outgoing calls
no test coverage detected