MCPcopy Index your code
hub / github.com/cloudfoundry/multiapps-cli-plugin / copyFile

Function copyFile

util/archive_builder.go:177–196  ·  view source on GitHub ↗
(src, dest string)

Source from the content-addressed store, hash-verified

175}
176
177func copyFile(src, dest string) error {
178 fileFrom, err := os.Open(src)
179 if err != nil {
180 return err
181 }
182 defer fileFrom.Close()
183
184 toFile, err := os.OpenFile(dest, os.O_RDWR|os.O_CREATE, 0666)
185 if err != nil {
186 return err
187 }
188 defer toFile.Close()
189
190 _, err = io.Copy(toFile, fileFrom)
191 if err != nil {
192 return err
193 }
194
195 return nil
196}
197
198func buildSection(elements map[string]string, locatorName string) []ManifestSection {
199 result := make([]ManifestSection, 0)

Callers 3

BuildMethod · 0.85
copyContentFunction · 0.85
copyDirectoryFunction · 0.85

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected