-
Notifications
You must be signed in to change notification settings - Fork 380
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
Request server: allow to open a file for both reading and writing #374
Comments
Proof of concept here on top of #373 The user who reported the issue has confirmed that it works. Please let me know if you prefer an alternative approach, thank you |
I would kind of rather see a more generic implementation of |
The current code calls the user defined interfaces based on request method:
see here since this is probably a backward incompatible change, do you want to replace the "Put" and "Get" method with an "OpenFile" method and then make different things based on packet type like this? |
add an optional interface to FileWriter to allow to open a file for both writing and reading Fixes pkg#374
Hi,
based on the SFTP specs opening a file for both reading and writing is allowed
pkg/sftp currently does not support this mode. I think this is the reason for this issue.
Here are the OpenSSH logs when opening a file using sshfs-win:
as you can see OpenSSH uses the same handle for both reads and writes.
How do you suggest to support this mode in pkg/sftp? Is ok a new request method, for example "PutGet" mapped to a new interface, for example Filereadwrite that returns both an io.ReaderAt and an io.WriterAt? Do you have other suggestions? Thank you
The text was updated successfully, but these errors were encountered: