| 41 | } |
| 42 | |
| 43 | bool WinRename(const TString& oldPath, const TString& newPath) { |
| 44 | TUtf16String op, np; |
| 45 | LPCWSTR opPtr = UTF8ToWCHAR(oldPath, op); |
| 46 | LPCWSTR npPtr = UTF8ToWCHAR(newPath, np); |
| 47 | if (!opPtr || !npPtr) { |
| 48 | ::SetLastError(ERROR_INVALID_NAME); |
| 49 | return false; |
| 50 | } |
| 51 | |
| 52 | return MoveFileExW(opPtr, npPtr, MOVEFILE_REPLACE_EXISTING) != 0; |
| 53 | } |
| 54 | |
| 55 | bool WinRemove(const TString& path) { |
| 56 | TUtf16String wstr; |