MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / temporaryFileName

Method temporaryFileName

source/core/StarFile_windows.cpp:155–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155String File::temporaryFileName() {
156 WCHAR tempPath[MAX_PATH];
157 if (!GetTempPathW(MAX_PATH, tempPath)) {
158 auto error = GetLastError();
159 throw IOException(strf("Could not call GetTempPath {}", error));
160 }
161
162 return relativeTo(utf16ToString(tempPath), strf("starbound.tmpfile.{}", hexEncode(Random::randBytes(16))));
163}
164
165FilePtr File::temporaryFile() {
166 return open(temporaryFileName(), IOMode::ReadWrite);

Callers

nothing calls this directly

Calls 4

strfFunction · 0.85
utf16ToStringFunction · 0.85
hexEncodeFunction · 0.85
randBytesFunction · 0.85

Tested by

no test coverage detected