We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
withTemporaryDirectory
1 parent f2f70f1 commit f569b0bCopy full SHA for f569b0b
Tests/WITExtractorTests/TestSupport.swift
@@ -47,9 +47,18 @@ struct TestSupport {
47
let templatePath = tempdir.appendingPathComponent("WasmKit.XXXXXX")
48
var template = [UInt8](templatePath.path.utf8).map({ Int8($0) }) + [Int8(0)]
49
50
+ #if os(Windows)
51
+ if _mktemp_s(&template, template.count) != 0 {
52
+ throw Error(errno: errno)
53
+ }
54
+ if _mkdir(template) != 0 {
55
56
57
+ #else
58
if mkdtemp(&template) == nil {
59
throw Error(errno: errno)
60
}
61
+ #endif
62
63
let path = String(cString: template)
64
defer { _ = try? FileManager.default.removeItem(atPath: path) }
0 commit comments