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

x/net/webdav: FileSystem interface should include CopyFile #38974

Open
fstanis opened this issue May 9, 2020 · 2 comments
Open

x/net/webdav: FileSystem interface should include CopyFile #38974

fstanis opened this issue May 9, 2020 · 2 comments

Comments

@fstanis
Copy link

@fstanis fstanis commented May 9, 2020

WebDAV requires support for the COPY method (defined in RFC 2518 section 8.8). Go's WebDAV server implementation in golang.org/x/net/webdav implements it, however the current implementation simply calls FileSystem.OpenFile on the source and destination and uses io.Copy to pipe the content.

While this is fine in some cases, I really think that the user should be able to override / implement this by adding a CopyFile method to the FileSystem interface. Two major reasons I see:

  • The current implementation is inefficient on filesystems that support copy-on-write.
  • The current implementation is inefficient on remote filesystems (effectively, it will pull a file locally and send it back).
@gopherbot gopherbot added this to the Unreleased milestone May 9, 2020
@toothrot
Copy link
Contributor

@toothrot toothrot commented May 11, 2020

I am not certain who owns x/net these days.
/cc @bradfitz @ianlancetaylor

@fstanis
Copy link
Author

@fstanis fstanis commented May 11, 2020

BTW happy to send a PR, just wanted to get an opinion on whether this kind of API change is a good idea first.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.