This is an old revision of the document!
Session.EnumerateRemoteFiles Method
Recursively enumerates remote files.
Advertisement
Syntax
C#
public IEnumerable<RemoteFileInfo> EnumerateRemoteFiles(string path, string mask, EnumerationOptions options)
VB.NET
Public Function EnumerateFiles(ByVal path As String, ByVal mask As String, ByVal options As EnumerationOptions) As IEnumerable(Of RemoteFileInfo)
Return Value
An enumerable collection of the RemoteFileInfo
instances representing matched files (and directories, if EnumerationOptions.MatchDirectories
or EnumerationOptions.EnumerateDirectories
option is used).
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | Session is not opened. |
ArgumentException | Invalid combination of options . |
SessionLocalException | Error communicating with winscp.com . See the exception documentation for details. |
SessionRemoteException | Session has failed. Enumeration of files has failed. See the exception documentation for details. |
TimeoutException | Timeout waiting for winscp.com to respond. |
Remarks
References to this directory (.
) and parent directory (..
) are never enumerated.
Advertisement
Use RemoteFileInfo.FullName
to retrieve a full path to the enumerated file or directory.
Errors, when listing subfolders, are silently ignored. You can use the Session.Failed
event to capture these errors.