| 153 | } |
| 154 | |
| 155 | String 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 | |
| 165 | FilePtr File::temporaryFile() { |
| 166 | return open(temporaryFileName(), IOMode::ReadWrite); |
nothing calls this directly
no test coverage detected