MCPcopy
hub / github.com/git-lfs/git-lfs / CloneFileByPath

Function CloneFileByPath

tools/util_windows.go:69–83  ·  view source on GitHub ↗
(dst, src string)

Source from the content-addressed store, hash-verified

67}
68
69func CloneFileByPath(dst, src string) (success bool, err error) {
70 dstFile, err := os.OpenFile(dst, os.O_RDWR|os.O_CREATE, 0666) // No truncate version of os.Create
71 if err != nil {
72 return
73 }
74 defer dstFile.Close()
75
76 srcFile, err := os.Open(src)
77 if err != nil {
78 return
79 }
80 defer srcFile.Close()
81
82 return CloneFile(dstFile, srcFile)
83}
84
85func CloneFile(writer io.Writer, reader io.Reader) (success bool, err error) {
86 dst, dstIsFile := writer.(*os.File)

Callers

nothing calls this directly

Calls 2

CloneFileFunction · 0.70
CloseMethod · 0.65

Tested by

no test coverage detected