mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
ef49b4ca78
commit
92c57363e0
7 changed files with 102 additions and 59 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue