diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-01-17 12:40:45 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-01-17 12:40:45 +0100 |
commit | 3e45412327a2654a77944249962b3652e6142299 (patch) | |
tree | bc3bf69452afa055423cbe0c5cfa8ca357df6ccf /src/pkg/os/path.go | |
parent | c533680039762cacbc37db8dc7eed074c3e497be (diff) | |
download | golang-upstream/2011.01.12.tar.gz |
Imported Upstream version 2011.01.12upstream/2011.01.12
Diffstat (limited to 'src/pkg/os/path.go')
-rw-r--r-- | src/pkg/os/path.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/pkg/os/path.go b/src/pkg/os/path.go index 36f497a1a..b762971d9 100644 --- a/src/pkg/os/path.go +++ b/src/pkg/os/path.go @@ -12,9 +12,9 @@ package os // directories that MkdirAll creates. // If path is already a directory, MkdirAll does nothing // and returns nil. -func MkdirAll(path string, perm int) Error { +func MkdirAll(path string, perm uint32) Error { // If path exists, stop with success or error. - dir, err := Lstat(path) + dir, err := Stat(path) if err == nil { if dir.IsDirectory() { return nil @@ -84,7 +84,6 @@ func RemoveAll(path string) Error { if err != nil { return err } - defer fd.Close() // Remove contents & return first error. err = nil @@ -105,6 +104,9 @@ func RemoveAll(path string) Error { } } + // Close directory, because windows won't remove opened directory. + fd.Close() + // Remove directory. err1 := Remove(path) if err == nil { |