diff --git a/Renci.SshClient/Renci.SshNet/Sftp/Responses/SftpNameResponse.cs b/Renci.SshClient/Renci.SshNet/Sftp/Responses/SftpNameResponse.cs index 59338ddc..c43438da 100644 --- a/Renci.SshClient/Renci.SshNet/Sftp/Responses/SftpNameResponse.cs +++ b/Renci.SshClient/Renci.SshNet/Sftp/Responses/SftpNameResponse.cs @@ -14,11 +14,11 @@ namespace Renci.SshNet.Sftp.Responses public uint Count { get; private set; } - public IDictionary Files { get; private set; } + public KeyValuePair[] Files { get; private set; } public SftpNameResponse() { - this.Files = new Dictionary(); + this.Files = new KeyValuePair[0]; } protected override void LoadData() @@ -26,14 +26,14 @@ namespace Renci.SshNet.Sftp.Responses base.LoadData(); this.Count = this.ReadUInt32(); + this.Files = new KeyValuePair[this.Count]; for (int i = 0; i < this.Count; i++) { var fileName = this.ReadString(); this.ReadString(); // This field value has meaningless information var attributes = this.ReadAttributes(); - - this.Files.Add(fileName, attributes); + this.Files[i] = new KeyValuePair(fileName, attributes); } } } diff --git a/Renci.SshClient/Renci.SshNet/Sftp/SftpSession.cs b/Renci.SshClient/Renci.SshNet/Sftp/SftpSession.cs index 78651153..8924a967 100644 --- a/Renci.SshClient/Renci.SshNet/Sftp/SftpSession.cs +++ b/Renci.SshClient/Renci.SshNet/Sftp/SftpSession.cs @@ -105,7 +105,7 @@ namespace Renci.SshNet.Sftp if (realPathFiles != null) { - canonizedPath = realPathFiles.Keys.First(); + canonizedPath = realPathFiles.First().Key; } if (!string.IsNullOrEmpty(canonizedPath)) @@ -129,10 +129,9 @@ namespace Renci.SshNet.Sftp if (realPathFiles != null) { - canonizedPath = realPathFiles.Keys.First(); + canonizedPath = realPathFiles.First().Key; } - if (string.IsNullOrEmpty(canonizedPath)) { return fullPath; @@ -170,7 +169,7 @@ namespace Renci.SshNet.Sftp this.ProtocolVersion = 3; // Resolve current directory - this.WorkingDirectory = this.RequestRealPath(".").Keys.First(); + this.WorkingDirectory = this.RequestRealPath(".").First().Key; } protected override void OnDataReceived(uint dataTypeCode, byte[] data) @@ -592,9 +591,9 @@ namespace Renci.SshNet.Sftp /// /// The handle. /// - internal IDictionary RequestReadDir(byte[] handle) + internal KeyValuePair[] RequestReadDir(byte[] handle) { - IDictionary result = null; + KeyValuePair[] result = null; using (var wait = new AutoResetEvent(false)) { @@ -711,9 +710,9 @@ namespace Renci.SshNet.Sftp /// The path. /// if set to true returns null instead of throwing an exception. /// - internal IDictionary RequestRealPath(string path, bool nullOnError = false) + internal KeyValuePair[] RequestRealPath(string path, bool nullOnError = false) { - IDictionary result = null; + KeyValuePair[] result = null; using (var wait = new AutoResetEvent(false)) { @@ -817,9 +816,9 @@ namespace Renci.SshNet.Sftp /// The path. /// if set to true returns null instead of throwing an exception. /// - internal IDictionary RequestReadLink(string path, bool nullOnError = false) + internal KeyValuePair[] RequestReadLink(string path, bool nullOnError = false) { - IDictionary result = null; + KeyValuePair[] result = null; using (var wait = new AutoResetEvent(false)) {