ListDir method will send request to the server to
retrieve FULL listing of a directory, given by RemotePath argument. Once server sends data,
event will be fired containing all the file listed by the
server - each one in separate line, split by CRLF
sequence. If server supports MLSD/MLST extensions, this command will
send MLSD. If those extensions are not supported, LIST command is
sent (in FTP protocol).
Once completed, Done event will
be fired. If no error occurs, ErrorCode argument in Done event will be set to
0 (zero). If error occurred, ErrorCode will hold number for the error, and
ErrorText will contain description
for the error. You can use
to access parsed collection of items from listed directory.
To get only filenames (and directory names) for specific
path, you can use ListNames
No wildcards can be used for RemotePath argument. RFC protocol
specifications for FTP and SFTP do 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).