nsIProcess

Methods

init(executable)

Initialises the process with an executable to be run. Call the run method
to run the executable.

Parameters

executable The executable to run.

kill()

Kills the running process. After exiting the process will either have
been killed or a failure will have been returned.

run(blocking, args, count)

Executes the file this object was initialized with

Parameters

blocking Whether to wait until the process terminates before returning or not.
args An array of arguments to pass to the process in the native character set.
count The length of the args array.

runAsync(args, count, observer, holdWeak)

Executes the file this object was initialized with optionally calling
an observer after the process has finished running.

Parameters

args An array of arguments to pass to the process in the native character set.
count The length of the args array.
observer An observer to notify when the process has completed. It will receive this process instance as the subject and "process-finished" or "process-failed" as the topic. The observer will be notified on the main thread.
holdWeak Whether to use a weak reference to hold the observer.

runw(blocking, args, count)

Executes the file this object was initialized with

Parameters

blocking Whether to wait until the process terminates before returning or not.
args An array of arguments to pass to the process in UTF-16
count The length of the args array.

runwAsync(args, count, observer, holdWeak)

Executes the file this object was initialized with optionally calling
an observer after the process has finished running.

Parameters

args An array of arguments to pass to the process in UTF-16
count The length of the args array.
observer An observer to notify when the process has completed. It will receive this process instance as the subject and "process-finished" or "process-failed" as the topic. The observer will be notified on the main thread.
holdWeak Whether to use a weak reference to hold the observer.

Attributes

pid

The process identifier of the currently running process. This will only
be available after the process has started and may not be available on
some platforms.

exitValue

The exit value of the process. This is only valid after the process has
exited.

isRunning

Returns whether the process is currently running or not.