Files
RemLink/internal/siteprofile/replace_windows.go
T
qsc20001102 142e5dc7d6
ci / Go checks (ubuntu-latest) (push) Has been cancelled
ci / Go checks (windows-latest) (push) Has been cancelled
初版功能完成
2026-08-29 13:12:17 +08:00

19 lines
453 B
Go

//go:build windows
package siteprofile
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)
}