Back to product page

ListDir method


Lists contents of a directory on the server.

Type

Void

Syntax

  • C#
  • VB.NET
public Void ListDir();

public Void ListDir(Stream ToStream);
The ListDir(ToStream) syntax has these parts:
ToStreamLocal stream that where wodFtpDLX.NET will write data to.

public Void ListDir(String RemotePath);
The ListDir(RemotePath) syntax has these parts:
RemotePathFull path to a directory on the server.

public Void ListDir(String RemotePath, Stream ToStream);
The ListDir(RemotePath,ToStream) syntax has these parts:
RemotePathFull path to a directory on the server.
ToStreamLocal stream that where wodFtpDLX.NET will write data to.

public Void ListDir(String RemotePath, String ListParams);
The ListDir(RemotePath,ListParams) syntax has these parts:
RemotePathFull path to a directory on the server.
ListParamsAdditional parameters for LIST command.

public Void ListDir(String RemotePath, String ListParams, Stream ToStream);
The ListDir(RemotePath,ListParams,ToStream) syntax has these parts:
RemotePathFull path to a directory on the server.
ListParamsAdditional parameters for LIST command.
ToStreamLocal stream that where wodFtpDLX.NET will write data to.

public Sub ListDir()

public Sub ListDir(ByVal ToStream As Stream)
The ListDir(ToStream) syntax has these parts:
ToStreamLocal stream that where wodFtpDLX.NET will write data to.

public Sub ListDir(ByVal RemotePath As String)
The ListDir(RemotePath) syntax has these parts:
RemotePathFull path to a directory on the server.

public Sub ListDir(ByVal RemotePath As String, ByVal ToStream As Stream)
The ListDir(RemotePath,ToStream) syntax has these parts:
RemotePathFull path to a directory on the server.
ToStreamLocal stream that where wodFtpDLX.NET will write data to.

public Sub ListDir(ByVal RemotePath As String, ByVal ListParams As String)
The ListDir(RemotePath,ListParams) syntax has these parts:
RemotePathFull path to a directory on the server.
ListParamsAdditional parameters for LIST command.

public Sub ListDir(ByVal RemotePath As String, ByVal ListParams As String, ByVal ToStream As Stream)
The ListDir(RemotePath,ListParams,ToStream) syntax has these parts:
RemotePathFull path to a directory on the server.
ListParamsAdditional parameters for LIST command.
ToStreamLocal stream that where wodFtpDLX.NET will write data to.

Remarks

ListDir method will send request to the server to retrieve FULL listing of a directory, given by RemotePath argument. Once server sends data, ListItems event will be fired containing all the files listed by the server - each one in separate line, split by CRLF sequence.

Once completed, Done event will be fired. If no error occurs, Args.Error argument in Done event will be set to null (Nothing in VB). If error occurred, Args.Error will contain description of the error. You can use DirItems property to access parsed collection of items from listed directory.

To get only filenames (and directory names) for specific path, you can use ListNames method.

No wildcards can be used for RemotePath argument. RFC protocol specification for SFTP does not allow them.

Do not forget that RemotePath should always specify full absolute path (i.e. /home/joe/something) instead of relative path (i.e. joe/something).

Platforms

Windows