os: windows Rename should overwrite destination file.

Rename now uses MoveFileEx which was previously not available to
use because it is not supported on Windows 2000.

Change-Id: I583d029c4467c9be6d1574a790c423559b441e87
Reviewed-on: https://go-review.googlesource.com/6140
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Daniel Theophanes 2015-02-26 12:10:11 -08:00 committed by Brad Fitzpatrick
parent ef49b4ca78
commit 92c57363e0
7 changed files with 102 additions and 59 deletions

View file

@ -12,6 +12,14 @@ import (
"syscall"
)
func rename(oldname, newname string) error {
e := syscall.Rename(oldname, newname)
if e != nil {
return &LinkError{"rename", oldname, newname, e}
}
return nil
}
// File represents an open file descriptor.
type File struct {
*file