internal KeyValuePair<string, SftpFileAttributes>[] RequestReadLink(string path, bool nullOnError = false)
{
if (ProtocolVersion < 3)
{
throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "SSH_FXP_READLINK operation is not supported in {0} version that server operates in.", ProtocolVersion));
}
SshException exception = null;
KeyValuePair<string, SftpFileAttributes>[] result = null;
using (var wait = new AutoResetEvent(false))
{
var request = new SftpReadLinkRequest(ProtocolVersion, NextRequestId, path, Encoding,
response =>
{
result = response.Files;
wait.Set();
},
response =>
{
exception = GetSftpException(response);
wait.Set();
});
SendRequest(request);
WaitOnHandle(wait, OperationTimeout);
}
if (!nullOnError && exception != null)
{
throw exception;
}
return result;
}