diff options
Diffstat (limited to 'libgo/go/exec/exec.go')
-rw-r--r-- | libgo/go/exec/exec.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libgo/go/exec/exec.go b/libgo/go/exec/exec.go index 80f6f3c..44e3b65 100644 --- a/libgo/go/exec/exec.go +++ b/libgo/go/exec/exec.go @@ -75,17 +75,19 @@ func modeToFiles(mode, fd int) (*os.File, *os.File, os.Error) { // Run starts the named binary running with // arguments argv and environment envv. +// If the dir argument is not empty, the child changes +// into the directory before executing the binary. // It returns a pointer to a new Cmd representing // the command or an error. // -// The parameters stdin, stdout, and stderr +// The arguments stdin, stdout, and stderr // specify how to handle standard input, output, and error. // The choices are DevNull (connect to /dev/null), // PassThrough (connect to the current process's standard stream), // Pipe (connect to an operating system pipe), and // MergeWithStdout (only for standard error; use the same // file descriptor as was used for standard output). -// If a parameter is Pipe, then the corresponding field (Stdin, Stdout, Stderr) +// If an argument is Pipe, then the corresponding field (Stdin, Stdout, Stderr) // of the returned Cmd is the other end of the pipe. // Otherwise the field in Cmd is nil. func Run(name string, argv, envv []string, dir string, stdin, stdout, stderr int) (c *Cmd, err os.Error) { @@ -105,7 +107,7 @@ func Run(name string, argv, envv []string, dir string, stdin, stdout, stderr int } // Run command. - c.Process, err = os.StartProcess(name, argv, envv, dir, fd[0:]) + c.Process, err = os.StartProcess(name, argv, &os.ProcAttr{Dir: dir, Files: fd[:], Env: envv}) if err != nil { goto Error } |