Discuss this help topic in SecureBlackbox Forum
SFTP: List files
Use ListDirectory() method of TElSimpleSFTPClient class to read the directory contents. If you have an open directory handle, you can use ReadDirectory() method of TElSimpleSFTPClient class instead.
You need to pass the container for directory information records in Listing parameter. The container will be filled with references to instances of TElSftpFileInfo class. Each instance contains information about a directory entry (file, subdirectory, symlink etc.).
In VCL edition remember to dispose of all objects, which are present in the container. TElSftpFileInfo contains the name of the entry and a reference to its attributes. Read more about attributes in the corresponding how-to article. LongName property of TElSftpFileInfo class contains information which is considered obsolete in the recent (> 3) versions of SFTP protocol.
For information about error handling, see the corresponding how-to article.