| 109 | } |
| 110 | |
| 111 | bool WinHardLink(const TString& existingPath, const TString& newPath) { |
| 112 | TUtf16String ep, np; |
| 113 | LPCWSTR epPtr = UTF8ToWCHAR(existingPath, ep); |
| 114 | LPCWSTR npPtr = UTF8ToWCHAR(newPath, np); |
| 115 | if (!epPtr || !npPtr) { |
| 116 | ::SetLastError(ERROR_INVALID_NAME); |
| 117 | return false; |
| 118 | } |
| 119 | |
| 120 | return (CreateHardLinkW(npPtr, epPtr, nullptr) != 0); |
| 121 | } |
| 122 | |
| 123 | bool WinExists(const TString& path) { |
| 124 | TUtf16String buf; |