Discuss this help topic in SecureBlackbox Forum
Lists the contents of the directory on the remote server
Declaration
Parameters
- Path - path to the directory to read
- Listing - the list will be filled by instances of the TElSftpFileInfo class, which represent the entries in the remote directory
- Mask - specifies the mask (wildcards) to select the names. Only the names of the files and directories, that match the mask, will be returned.
Note, that SFTP doesn't support name masks, so no matter what mask you specify, the whole directory will be read and then scanned for matches.
- CaseSensitive - specifies whether the mask is case-sensitive.
- IncludeFiles - specifies whether the names of the files and symlinks is returned.
- IncludeDirectories - specifies whether the names of the directories is returned.
- Recursive - set this parameter to True to perform a recursive search, i.e., including subdirectories.
Description
Use this method to list contents of the directory.
In case of error, EElSFTPError exception containing the SFTP error code, is raised.
For more information on error handling, please read the corresponding how-to article.
ListDirectory should be called once per enumeration: it returns the complete directory contents.
Files are chosen by the mask which can be a simple mask, a set of masks or a regular expression (read more about masks).
Since SecureBlackbox version 13, file masks in group operations support expressions.
[Pascal]
Note, all TElSftpFileInfo objects returned by this function are not destroyed by TElSimpleSFTPClient and thus *must* be freed by user application.
Discuss this help topic in SecureBlackbox Forum