(source io.Reader, destinationPath string)
| 56 | } |
| 57 | |
| 58 | func (l *Local) copyFile(source io.Reader, destinationPath string) (int64, error) { |
| 59 | dest, err := os.Create(destinationPath) |
| 60 | if err != nil { |
| 61 | return 0, errors.Wrap(err, "failed to create destination file") |
| 62 | } |
| 63 | |
| 64 | defer dest.Close() |
| 65 | |
| 66 | written, err := io.Copy(dest, source) |
| 67 | if err != nil { |
| 68 | return 0, errors.Wrap(err, "failed to copy data") |
| 69 | } |
| 70 | |
| 71 | return written, nil |
| 72 | } |
| 73 | |
| 74 | func (l *Local) Size(_ctx context.Context, name string) (int64, error) { |
| 75 | file, err := l.Open(name) |