Open
Description
Description
Process()
doesn't launch the right executable on Windows.
Steps to reproduce
Compile and run this program on a standard Windows installation.
import Foundation
let p = Process()
p.executableURL = URL(fileURLWithPath: #"C:\Windows\System32\cmd.exe"#)
p.arguments = ["/?"]
do {
try p.run()
p.waitUntilExit()
}
catch let e { fatalError("0. threw \(e)") }
if p.terminationStatus != 0 { fatalError("0. exit status: \(p.terminationStatus)") }
Expected behavior
Prints the output of running c:\Windows\System32\cmd.exe /?
and fatal errors with a nonzero exit status.
Actual behavior
Prints the output of running c:\Windows\System32\MKDIR.exe /?
and fatal errors with a nonzero exit status.
Environment
swift --version
compnerd.org Swift version 5.9-dev (LLVM 466a716843b7efb, Swift 39bac1c)
Target: x86_64-unknown-windows-msvc