MCPcopy Create free account
hub / github.com/catboost/catboost / CreateFileWithUtf8Name

Function CreateFileWithUtf8Name

util/system/fs_win.cpp:29–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 }
28
29 HANDLE CreateFileWithUtf8Name(const TStringBuf fName, ui32 accessMode, ui32 shareMode, ui32 createMode, ui32 attributes, bool inheritHandle) {
30 TUtf16String wstr;
31 LPCWSTR wname = UTF8ToWCHAR(fName, wstr);
32 if (!wname) {
33 ::SetLastError(ERROR_INVALID_NAME);
34 return INVALID_HANDLE_VALUE;
35 }
36 SECURITY_ATTRIBUTES secAttrs;
37 secAttrs.bInheritHandle = inheritHandle ? TRUE : FALSE;
38 secAttrs.lpSecurityDescriptor = nullptr;
39 secAttrs.nLength = sizeof(secAttrs);
40 return ::CreateFileW(wname, accessMode, shareMode, &secAttrs, createMode, attributes, nullptr);
41 }
42
43 bool WinRename(const TString& oldPath, const TString& newPath) {
44 TUtf16String op, np;

Callers 2

WinReadLinkFunction · 0.85
GetStatByNameFunction · 0.85

Calls 1

UTF8ToWCHARFunction · 0.70

Tested by

no test coverage detected