diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-12-03 02:17:34 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-12-03 02:17:34 +0000 |
commit | 2fd401c8f190f1fe43e51a7f726f6ed6119a1f96 (patch) | |
tree | 7f76eff391f37fe6467ff4ffbc0c582c9959ea30 /libgo/go/os/path.go | |
parent | 02e9018f1616b23f1276151797216717b3564202 (diff) | |
download | gcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.zip gcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.tar.gz gcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.tar.bz2 |
libgo: Update to weekly.2011-11-02.
From-SVN: r181964
Diffstat (limited to 'libgo/go/os/path.go')
-rw-r--r-- | libgo/go/os/path.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libgo/go/os/path.go b/libgo/go/os/path.go index b190c51..82fade6 100644 --- a/libgo/go/os/path.go +++ b/libgo/go/os/path.go @@ -4,6 +4,8 @@ package os +import "io" + // MkdirAll creates a directory named path, // along with any necessary parents, and returns nil, // or else returns an error. @@ -11,7 +13,7 @@ package os // directories that MkdirAll creates. // If path is already a directory, MkdirAll does nothing // and returns nil. -func MkdirAll(path string, perm uint32) Error { +func MkdirAll(path string, perm uint32) error { // If path exists, stop with success or error. dir, err := Stat(path) if err == nil { @@ -58,7 +60,7 @@ func MkdirAll(path string, perm uint32) Error { // It removes everything it can but returns the first error // it encounters. If the path does not exist, RemoveAll // returns nil (no error). -func RemoveAll(path string) Error { +func RemoveAll(path string) error { // Simple case: if Remove works, we're done. err := Remove(path) if err == nil { @@ -68,7 +70,7 @@ func RemoveAll(path string) Error { // Otherwise, is this a directory we need to recurse into? dir, serr := Lstat(path) if serr != nil { - if serr, ok := serr.(*PathError); ok && (serr.Error == ENOENT || serr.Error == ENOTDIR) { + if serr, ok := serr.(*PathError); ok && (serr.Err == ENOENT || serr.Err == ENOTDIR) { return nil } return serr @@ -94,7 +96,7 @@ func RemoveAll(path string) Error { err = err1 } } - if err1 == EOF { + if err1 == io.EOF { break } // If Readdirnames returned an error, use it. |