summaryrefslogtreecommitdiff
path: root/src/pkg/os/path.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/os/path.go')
-rw-r--r--src/pkg/os/path.go8
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 {