1
0
mirror of https://github.com/golang/go synced 2024-11-21 15:14:43 -07:00

os: make RemoveAll() work on windows

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/2212041
This commit is contained in:
Alex Brainman 2010-09-17 12:35:34 +10:00
parent 7534d40f64
commit 9997dae7a3

View File

@ -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 {