| 419 | } |
| 420 | |
| 421 | static bool ftruncate(MMKVFileHandle_t file, size_t size) { |
| 422 | LARGE_INTEGER large = {}; |
| 423 | large.QuadPart = size; |
| 424 | if (SetFilePointerEx(file, large, 0, FILE_BEGIN)) { |
| 425 | if (SetEndOfFile(file)) { |
| 426 | return true; |
| 427 | } |
| 428 | MMKVError("fail to SetEndOfFile:%d", GetLastError()); |
| 429 | return false; |
| 430 | } else { |
| 431 | MMKVError("fail to SetFilePointer:%d", GetLastError()); |
| 432 | return false; |
| 433 | } |
| 434 | } |
| 435 | |
| 436 | static bool getFileSize(MMKVFileHandle_t fd, size_t &size) { |
| 437 | LARGE_INTEGER filesize = {0}; |
no outgoing calls
no test coverage detected