class func run(URL, arguments: [String], terminationHandler : ((Process) -> Void)?) -> Process
init()
Availability 有効性
Technology
class Process : NSObject
Using the Process
class, your program can run another program as a subprocess and can monitor that program’s execution. A Process
object creates a separate executable entity; it’s different from Thread
because it doesn’t share memory space with the process that creates it.
A process operates within an environment defined by the current values for several items: the current directory, standard input, standard output, standard error, and the values of any environment variables.
プロセスは、いくつかの項目:現在のディレクトリ、標準入力、標準出力、標準エラー、そして何らかの環境変数の値に対して、現在の値によって定義されるある環境内で演算します。
By default, a Process
object inherits its environment from the process that launches it. If there are any values that should be different for the process (for example, if the current directory needs to change), change the value before your app launches it. Your app can’t change a process’s environment while it’s running.
You can only run a Process
object once. Subsequent attempts raise an error.
その後の試みはエラーを引き起こします。
Important 重要
In a sandboxed app, child processes you create with the Process
class inherit the sandbox of the parent app. Instead, write helper apps as XPC Services because it allows you to specify different sandbox entitlements for helper apps. For more information, see Daemons and Services Programming Guide and XPC.
class func run(URL, arguments: [String], terminationHandler : ((Process) -> Void)?) -> Process
init()
var processIdentifier : Int32
func run()
func interrupt()
func resume() -> Bool
func suspend() -> Bool
func terminate()
func waitUntilExit ()
var isRunning : Bool
var terminationStatus : Int32
var terminationReason : Process.TerminationReason
var arguments: [String]?
var currentDirectoryURL : URL?
var environment: [String : String]?
var executableURL : URL?
var qualityOfService : QualityOfService
var standardError : Any?
var standardInput : Any?
var standardOutput : Any?
var terminationHandler : ((Process) -> Void)?
enum Process.TerminationReason
enum QualityOfService
class let didTerminateNotification : NSNotification.Name
class func launchedProcess (launchPath : String, arguments: [String]) -> Process
var currentDirectoryPath : String
class Pipe