mirror of
https://github.com/golang/go
synced 2024-11-21 21:14:47 -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:
parent
7534d40f64
commit
9997dae7a3
@ -84,7 +84,6 @@ func RemoveAll(path string) Error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer fd.Close()
|
|
||||||
|
|
||||||
// Remove contents & return first error.
|
// Remove contents & return first error.
|
||||||
err = nil
|
err = nil
|
||||||
@ -105,6 +104,9 @@ func RemoveAll(path string) Error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Close directory, because windows won't remove opened directory.
|
||||||
|
fd.Close()
|
||||||
|
|
||||||
// Remove directory.
|
// Remove directory.
|
||||||
err1 := Remove(path)
|
err1 := Remove(path)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user