def spawn(cls, executable, args, path, env, spawnProcess=None):
d = defer.Deferred()<EOL>proto = cls(d, filepath.FilePath(path))<EOL>if spawnProcess is None:<EOL><INDENT>spawnProcess = reactor.spawnProcess<EOL><DEDENT>spawnProcess(<EOL>proto,<EOL>executable,<EOL>[executable] + args,<EOL>path=path,<EOL>env=env,<EOL>childFDs={<NUM_LIT:0>: '<STR_LIT:w>', <NUM_LIT:1>: '<STR_LIT:r>', <NUM_LIT:2>: '<STR_LIT:r>',<EOL>cls.BACKCHANNEL_OUT: '<STR_LIT:r>',<EOL>cls.BACKCHANNEL_IN: '<STR_LIT:w>'})<EOL>return d<EOL>
Run an executable with some arguments in the given working directory with
the given environment variables.

Returns a Deferred which fires with a two-tuple of (exit status, output
list) if the process terminates without timing out or being killed by a
signal.  Otherwise, the Deferred errbacks with either L{error.TimeoutError}
if any 10 minute period passes with no events or L{ProcessDied} if it is
killed by a signal.

On success, the output list is of two-tuples of (file descriptor, bytes).