diff options
| author | Rob Pike <r@golang.org> | 2011-04-04 23:42:14 -0700 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2011-04-04 23:42:14 -0700 |
| commit | 8a90fd3c72e7853a39ba348c0cd278b2d11ea610 (patch) | |
| tree | 7935e606dcf651b75afd52d337a1c11bff103fea /src/pkg/exec | |
| parent | 3ebc422ff807a2e7fae96c490ecbc55710adfc42 (diff) | |
| download | go-8a90fd3c72e7853a39ba348c0cd278b2d11ea610.tar.xz | |
os: New Open API.
We replace the current Open with:
OpenFile(name, flag, perm) // same as old Open
Open(name) // same as old Open(name, O_RDONLY, 0)
Create(name) // same as old Open(name, O_RDWR|O_TRUNC|O_CREAT, 0666)
This CL includes a gofix module and full code updates: all.bash passes.
(There may be a few comments I missed.)
The interesting packages are:
gofix
os
Everything else is automatically generated except for hand tweaks to:
src/pkg/io/ioutil/ioutil.go
src/pkg/io/ioutil/tempfile.go
src/pkg/crypto/tls/generate_cert.go
src/cmd/goyacc/goyacc.go
src/cmd/goyacc/units.y
R=golang-dev, bradfitzwork, rsc, r2
CC=golang-dev
https://golang.org/cl/4357052
Diffstat (limited to 'src/pkg/exec')
| -rw-r--r-- | src/pkg/exec/exec.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/exec/exec.go b/src/pkg/exec/exec.go index 44e3b65bec..75ce09990a 100644 --- a/src/pkg/exec/exec.go +++ b/src/pkg/exec/exec.go @@ -49,7 +49,7 @@ func modeToFiles(mode, fd int) (*os.File, *os.File, os.Error) { if fd == 0 { rw = os.O_RDONLY } - f, err := os.Open(os.DevNull, rw, 0) + f, err := os.OpenFile(os.DevNull, rw, 0) return f, nil, err case PassThrough: switch fd { |
