Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs.CopyFile should support copying metadata #175

Open
AkihiroSuda opened this issue Dec 21, 2020 · 0 comments
Open

fs.CopyFile should support copying metadata #175

AkihiroSuda opened this issue Dec 21, 2020 · 0 comments

Comments

@AkihiroSuda
Copy link
Member

continuity/fs/copy.go

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant