17 lines
446 B
Go
17 lines
446 B
Go
package backup
|
|
|
|
import "golang.org/x/sys/windows"
|
|
|
|
func publishRecord(source, dest string) error {
|
|
from, err := windows.UTF16PtrFromString(source)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
to, err := windows.UTF16PtrFromString(dest)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// The file was flushed before closing; request a completed on-disk replacement.
|
|
return windows.MoveFileEx(from, to, windows.MOVEFILE_REPLACE_EXISTING|windows.MOVEFILE_WRITE_THROUGH)
|
|
}
|