MCPcopy
hub / github.com/etcd-io/etcd / copyFile

Function copyFile

tests/integration/util_test.go:45–62  ·  view source on GitHub ↗
(src, dst string)

Source from the content-addressed store, hash-verified

43}
44
45func copyFile(src, dst string) error {
46 f, err := os.Open(src)
47 if err != nil {
48 return err
49 }
50 defer f.Close()
51
52 w, err := os.Create(dst)
53 if err != nil {
54 return err
55 }
56 defer w.Close()
57
58 if _, err = io.Copy(w, f); err != nil {
59 return err
60 }
61 return w.Sync()
62}

Callers 1

copyTLSFilesFunction · 0.70

Calls 5

OpenMethod · 0.80
CloseMethod · 0.65
CreateMethod · 0.65
CopyMethod · 0.65
SyncMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…