Files
cursor-byok/internal/client/config_transfer_replace_windows.go
T

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,
)
}