MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / tempDir

Function tempDir

src/env.cpp:1062–1078  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1060}
1061
1062std::wstring tempDir()
1063{
1064 const DWORD bufferSize = MAX_PATH + 1;
1065 wchar_t buffer[bufferSize + 1] = {};
1066
1067 const auto written = GetTempPathW(bufferSize, buffer);
1068 if (written == 0) {
1069 const auto e = GetLastError();
1070
1071 std::wcerr << L"failed to get temp path, " << formatSystemMessage(e) << L"\n";
1072
1073 return {};
1074 }
1075
1076 // `written` does not include the null terminator
1077 return std::wstring(buffer, buffer + written);
1078}
1079
1080std::wstring safeVersion()
1081{

Callers 1

dumpFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected