初版功能完成
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
//go:build windows
|
||||
|
||||
package identity
|
||||
|
||||
import "golang.org/x/sys/windows"
|
||||
|
||||
func replaceFile(source, destination string) error {
|
||||
sourcePointer, err := windows.UTF16PtrFromString(source)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
destinationPointer, err := windows.UTF16PtrFromString(destination)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return windows.MoveFileEx(sourcePointer, destinationPointer,
|
||||
windows.MOVEFILE_REPLACE_EXISTING|windows.MOVEFILE_WRITE_THROUGH)
|
||||
}
|
||||
Reference in New Issue
Block a user