Closed drakkan closed 4 years ago
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 OpenFile
rather than special casing Yet Another Narrow-Scope File Object Opener.
I would kind of rather see a more generic implementation of
OpenFile
rather than special casing Yet Another Narrow-Scope File Object Opener.
The current code calls the user defined interfaces based on request method:
Get
method is mapped to Fileread
Put
method is mapped to Filewrite
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?
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