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

Method temporaryDirectory

source/core/StarFile_windows.cpp:176–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176String File::temporaryDirectory() {
177 WCHAR tempPath[MAX_PATH];
178 if (!GetTempPathW(MAX_PATH, tempPath)) {
179 auto error = GetLastError();
180 throw IOException(strf("Could not call GetTempPath {}", error));
181 }
182
183 String dirname = relativeTo(utf16ToString(tempPath), strf("starbound.tmpdir.{}", hexEncode(Random::randBytes(16))));
184 makeDirectory(dirname);
185 return dirname;
186}
187
188void File::remove(String const& filename) {
189 if (isDirectory(filename)) {

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