internal SftpFileAttributes RequestStat(string path, bool nullOnError = false)
{
SshException exception = null;
SftpFileAttributes attributes = null;
using (var wait = new AutoResetEvent(false))
{
var request = new SftpStatRequest(ProtocolVersion, NextRequestId, path, Encoding,
response =>
{
attributes = response.Attributes;
wait.Set();
},
response =>
{
exception = GetSftpException(response);
wait.Set();
});
SendRequest(request);
WaitOnHandle(wait, OperationTimeout);
}
if (!nullOnError && exception != null)
{
throw exception;
}
return attributes;
}