internal SftpFileSytemInformation RequestFStatVfs(byte[] handle, bool nullOnError = false)
{
if (ProtocolVersion < 3)
{
throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "SSH_FXP_EXTENDED operation is not supported in {0} version that server operates in.", ProtocolVersion));
}
SshException exception = null;
SftpFileSytemInformation information = null;
using (var wait = new AutoResetEvent(false))
{
var request = new FStatVfsRequest(ProtocolVersion, NextRequestId, handle,
response =>
{
information = response.GetReply<StatVfsReplyInfo>().Information;
wait.Set();
},
response =>
{
exception = GetSftpException(response);
wait.Set();
});
if (!_supportedExtensions.ContainsKey(request.Name))
throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "Extension method {0} currently not supported by the server.", request.Name));
SendRequest(request);
WaitOnHandle(wait, OperationTimeout);
}
if (!nullOnError && exception != null)
{
throw exception;
}
return information;
}