Avatar
Kishikawa Katsumi 12/1/2022 2:29 PM
let stdout = Pipe() process.standardOutput = stdout let stderr = Pipe() process.standardError = stderr try process.run() process.waitUntilExit() if let data = try stderr.fileHandleForReading.readToEnd(), let error = String(data: data, encoding: .utf8) { print(error) } ... まあでもこんな感じでしょ。Foundation.Processでもまあいいんじゃないかなあ。