-
Couldn't load subscription status.
- Fork 68
Open
Labels
Description
Lines 161 to 176 in 1805252
| // CopyFile copies the source file to the target. | |
| // The most efficient means of copying is used for the platform. | |
| func CopyFile(target, source string) error { | |
| src, err := os.Open(source) | |
| if err != nil { | |
| return errors.Wrapf(err, "failed to open source %s", source) | |
| } | |
| defer src.Close() | |
| tgt, err := os.Create(target) | |
| if err != nil { | |
| return errors.Wrapf(err, "failed to open target %s", target) | |
| } | |
| defer tgt.Close() | |
| return copyFileContent(tgt, src) | |
| } |
The current implementation of CopyFile does not support copying metadata.
CopyFile should optionally copy the metadata as in CopyDir