The ListNames function will send a request to the server to
retrieve just the names of files and directories in the given
path. Once the server sends data, the ListItems
callback will be invoked (possibly more than once!)
containing a list of files sent by the server, each one on a
separate line, split by a CRLF sequence. If the item is a
directory, wodSFTP will append / (slash) to the end of it.
The ListItems event is fired more than once if the total number of
files is too large to be handled by one SFTP packet. So you should
wait for the Done
callback before declaring the listing as finished.
Once completed, the Done callback will be called. If no
error occurs, the ErrorCode argument in
the Done callback will be set to 0 (zero). If an error occurrs, the
ErrorCode will hold the number of the
error and ErrorText will contain a
description of the error.
No wildcards can be used with the RemotePath argument. The RFC
protocol specification for SFTP does not allow them.
To retrieve a full listing of files/directories on a given
path (including size, permissions, dates...) you should use the
ListDir
function. To retrieve the structure of a directory in a ready-parsed
array of WIN32_FIND_DATA structures, you should use the
ListAttributes
function.