| 174 | } |
| 175 | |
| 176 | String 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 | |
| 188 | void File::remove(String const& filename) { |
| 189 | if (isDirectory(filename)) { |
nothing calls this directly
no test coverage detected