0

It is handle after I configuring taskOuput's launchPath to "/usr/bin/sudo". How can I modify the code to make it works?

let theTask = Process()
let stdin = FileHandle(forReadingAtPath:"c")
let taskOutput = Pipe()
theTask.launchPath = "/usr/bin/sudo"
theTask.standardOutput = taskOutput
theTask.standardInput = stdin
theTask.standardError = taskOutput
theTask.arguments = ["mkdir", "/usr/local/newfolder"]
theTask.launch()
theTask.waitUntilExit()
Choasgtfe
  • 3
  • 3

0 Answers0