You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Asynchronously retrieves list of files in remote directory.
704
+
/// Asynchronously enumerates the files in remote directory.
704
705
/// </summary>
705
706
/// <param name="path">The path.</param>
706
707
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to observe.</param>
707
708
/// <returns>
708
-
/// A <see cref="Task{IEnumerable}"/> that represents the asynchronous list operation.
709
-
/// The task result contains an enumerable collection of <see cref="SftpFile"/> for the files in the directory specified by <paramref name="path" />.
709
+
/// An <see cref="IAsyncEnumerable{T}"/> of <see cref="ISftpFile"/> that represents the asynchronous enumeration operation.
710
+
/// The enumeration contains an async stream of <see cref="ISftpFile"/> for the files in the directory specified by <paramref name="path" />.
710
711
/// </returns>
711
712
/// <exception cref="ArgumentNullException"><paramref name="path" /> is <b>null</b>.</exception>
712
713
/// <exception cref="SshConnectionException">Client is not connected.</exception>
713
714
/// <exception cref="SftpPermissionDeniedException">Permission to list the contents of the directory was denied by the remote host. <para>-or-</para> A SSH command was denied by the server.</exception>
714
715
/// <exception cref="SshException">A SSH error where <see cref="Exception.Message" /> is the message from the remote host.</exception>
715
716
/// <exception cref="ObjectDisposedException">The method was called after the client was disposed.</exception>
Copy file name to clipboardExpand all lines: src/Renci.SshNet/SftpClient.cs
+11-10Lines changed: 11 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,9 @@
10
10
usingRenci.SshNet.Common;
11
11
usingRenci.SshNet.Sftp;
12
12
usingSystem.Threading.Tasks;
13
+
#if FEATURE_ASYNC_ENUMERABLE
14
+
usingSystem.Runtime.CompilerServices;
15
+
#endif
13
16
14
17
namespaceRenci.SshNet
15
18
{
@@ -92,7 +95,7 @@ public TimeSpan OperationTimeout
92
95
/// SSH_FXP_DATA protocol fields.
93
96
/// </para>
94
97
/// <para>
95
-
/// The size of the each indivual SSH_FXP_DATA message is limited to the
98
+
/// The size of the each individual SSH_FXP_DATA message is limited to the
96
99
/// local maximum packet size of the channel, which is set to <c>64 KB</c>
97
100
/// for SSH.NET. However, the peer can limit this even further.
98
101
/// </para>
@@ -584,21 +587,22 @@ public IEnumerable<ISftpFile> ListDirectory(string path, Action<int> listCallbac
584
587
returnInternalListDirectory(path,listCallback);
585
588
}
586
589
590
+
#if FEATURE_ASYNC_ENUMERABLE
587
591
/// <summary>
588
-
/// Asynchronously retrieves list of files in remote directory.
592
+
/// Asynchronously enumerates the files in remote directory.
589
593
/// </summary>
590
594
/// <param name="path">The path.</param>
591
595
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to observe.</param>
592
596
/// <returns>
593
-
/// A <see cref="Task{IEnumerable}"/> that represents the asynchronous list operation.
594
-
/// The task result contains an enumerable collection of <see cref="SftpFile"/> for the files in the directory specified by <paramref name="path" />.
597
+
/// An <see cref="IAsyncEnumerable{T}"/> of <see cref="ISftpFile"/> that represents the asynchronous enumeration operation.
598
+
/// The enumeration contains an async stream of <see cref="ISftpFile"/> for the files in the directory specified by <paramref name="path" />.
595
599
/// </returns>
596
600
/// <exception cref="ArgumentNullException"><paramref name="path" /> is <b>null</b>.</exception>
597
601
/// <exception cref="SshConnectionException">Client is not connected.</exception>
598
602
/// <exception cref="SftpPermissionDeniedException">Permission to list the contents of the directory was denied by the remote host. <para>-or-</para> A SSH command was denied by the server.</exception>
599
603
/// <exception cref="SshException">A SSH error where <see cref="Exception.Message" /> is the message from the remote host.</exception>
600
604
/// <exception cref="ObjectDisposedException">The method was called after the client was disposed.</exception>
0 commit comments