MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / copyFile

Function copyFile

internal/autoupdate/autoupdate.go:383–398  ·  view source on GitHub ↗
(src, dst string)

Source from the content-addressed store, hash-verified

381}
382
383func copyFile(src, dst string) error {
384 in, err := os.Open(src)
385 if err != nil {
386 return err
387 }
388 defer in.Close()
389 out, err := os.OpenFile(dst, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0o755)
390 if err != nil {
391 return err
392 }
393 defer out.Close()
394 if _, err := io.Copy(out, in); err != nil {
395 return err
396 }
397 return out.Sync()
398}
399
400// finalizeWindowsSwap attempts to replace tnr.exe with a previously staged tnr.new.
401// It is a no-op on non-Windows platforms.

Callers 6

InstallMethod · 0.85
installWithSudoFunction · 0.85
runWindowsMSIUpgradeFunction · 0.85
runElevatedStagingHelperFunction · 0.85
stageUpdateInDirFunction · 0.85

Calls 2

OpenMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected