summaryrefslogtreecommitdiff
path: root/src/pkg/io/ioutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/io/ioutil')
-rw-r--r--src/pkg/io/ioutil/Makefile2
-rw-r--r--src/pkg/io/ioutil/ioutil.go2
-rw-r--r--src/pkg/io/ioutil/ioutil_test.go12
-rw-r--r--src/pkg/io/ioutil/tempfile_test.go2
4 files changed, 9 insertions, 9 deletions
diff --git a/src/pkg/io/ioutil/Makefile b/src/pkg/io/ioutil/Makefile
index 77b75bcec..d406d4b7d 100644
--- a/src/pkg/io/ioutil/Makefile
+++ b/src/pkg/io/ioutil/Makefile
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../../Make.$(GOARCH)
+include ../../../Make.inc
TARG=io/ioutil
GOFILES=\
diff --git a/src/pkg/io/ioutil/ioutil.go b/src/pkg/io/ioutil/ioutil.go
index d33869380..fb3fdcda1 100644
--- a/src/pkg/io/ioutil/ioutil.go
+++ b/src/pkg/io/ioutil/ioutil.go
@@ -49,7 +49,7 @@ func ReadFile(filename string) ([]byte, os.Error) {
// WriteFile writes data to a file named by filename.
// If the file does not exist, WriteFile creates it with permissions perm;
// otherwise WriteFile truncates it before writing.
-func WriteFile(filename string, data []byte, perm int) os.Error {
+func WriteFile(filename string, data []byte, perm uint32) os.Error {
f, err := os.Open(filename, os.O_WRONLY|os.O_CREAT|os.O_TRUNC, perm)
if err != nil {
return err
diff --git a/src/pkg/io/ioutil/ioutil_test.go b/src/pkg/io/ioutil/ioutil_test.go
index ecbf41ca6..150ee6d63 100644
--- a/src/pkg/io/ioutil/ioutil_test.go
+++ b/src/pkg/io/ioutil/ioutil_test.go
@@ -37,7 +37,7 @@ func TestReadFile(t *testing.T) {
}
func TestWriteFile(t *testing.T) {
- filename := "_obj/rumpelstilzchen"
+ filename := "_test/rumpelstilzchen"
data := "Programming today is a race between software engineers striving to " +
"build bigger and better idiot-proof programs, and the Universe trying " +
"to produce bigger and better idiots. So far, the Universe is winning."
@@ -74,19 +74,19 @@ func TestReadDir(t *testing.T) {
}
foundTest := false
- foundObj := false
+ foundTestDir := false
for _, dir := range list {
switch {
case dir.IsRegular() && dir.Name == "ioutil_test.go":
foundTest = true
- case dir.IsDirectory() && dir.Name == "_obj":
- foundObj = true
+ case dir.IsDirectory() && dir.Name == "_test":
+ foundTestDir = true
}
}
if !foundTest {
t.Fatalf("ReadDir %s: test file not found", dirname)
}
- if !foundObj {
- t.Fatalf("ReadDir %s: _obj directory not found", dirname)
+ if !foundTestDir {
+ t.Fatalf("ReadDir %s: _test directory not found", dirname)
}
}
diff --git a/src/pkg/io/ioutil/tempfile_test.go b/src/pkg/io/ioutil/tempfile_test.go
index fe43f9566..d949a86cf 100644
--- a/src/pkg/io/ioutil/tempfile_test.go
+++ b/src/pkg/io/ioutil/tempfile_test.go
@@ -23,7 +23,7 @@ func TestTempFile(t *testing.T) {
t.Errorf("TempFile(dir, `ioutil_test`) = %v, %v", f, err)
}
if f != nil {
- re := testing.MustCompile("^" + regexp.QuoteMeta(dir) + "/ioutil_test[0-9]+$")
+ re := regexp.MustCompile("^" + regexp.QuoteMeta(dir) + "/ioutil_test[0-9]+$")
if !re.MatchString(f.Name()) {
t.Errorf("TempFile(`"+dir+"`, `ioutil_test`) created bad name %s", f.Name())
}