With the request-based API, the Close method on the object returned by Filewrite gets called whether the SFTP client actually sent a Close command or was interrupted during uploading and dropped the connection.
Is there some way to distinguish between these situations?
It is important for our use case that we avoid acting on files that were not fully uploaded by the client, so we need a way to know whether the client sent a SFTP Close command or if the Close on the object returned by Filewrite is due to another cause.
(We are currently using a fork of pkg/sftp from several years ago to which we have made several modifications, but now that the request based API is available, we want to use it instead of our fork. The request based API does almost everything we need, except for this ambiguity.)
If it is not currently possible to distinguish between these situations, would it be feasible for this library to utilize alternative/optional method(s) on the object returned by Filewrite to provide that information? (Or perhaps something could be added to Request that could be used to distinguish between the situations?)
With the request-based API, the
Close
method on the object returned byFilewrite
gets called whether the SFTP client actually sent a Close command or was interrupted during uploading and dropped the connection.Is there some way to distinguish between these situations?
It is important for our use case that we avoid acting on files that were not fully uploaded by the client, so we need a way to know whether the client sent a SFTP Close command or if the
Close
on the object returned byFilewrite
is due to another cause.(We are currently using a fork of
pkg/sftp
from several years ago to which we have made several modifications, but now that the request based API is available, we want to use it instead of our fork. The request based API does almost everything we need, except for this ambiguity.)If it is not currently possible to distinguish between these situations, would it be feasible for this library to utilize alternative/optional method(s) on the object returned by
Filewrite
to provide that information? (Or perhaps something could be added toRequest
that could be used to distinguish between the situations?)