mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-08-20 21:17:47 +08:00
22 lines
430 B
Go
22 lines
430 B
Go
//go:build windows
|
|
|
|
package client
|
|
|
|
import "golang.org/x/sys/windows"
|
|
|
|
func replaceExportFile(sourcePath, targetPath string) error {
|
|
source, err := windows.UTF16PtrFromString(sourcePath)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
target, err := windows.UTF16PtrFromString(targetPath)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return windows.MoveFileEx(
|
|
source,
|
|
target,
|
|
windows.MOVEFILE_REPLACE_EXISTING|windows.MOVEFILE_WRITE_THROUGH,
|
|
)
|
|
}
|