Discuss this help topic in SecureBlackbox Forum
Reads the contents of the opened directory on the server.
Declaration
Parameters
- Handle - handle to opened directory, returned by OpenDirectorymethod
- Listing - the list will be filled by instances of the TElSftpFileInfo class, which represent the entries in the remote directory
- NamesOnly - if the value is True, only the names of the files are returned.If the value is False, the following information is returned:<Name><SP>\<SP><TYPE><SP><SIZE><SP><AccessTime><SP><ModificationTime><SP><CreationTime>.Time is expressed in GeneralizedTime format.
If some parameter is not returned by the server, dash ("-") is put instead.
The list can be extended further, so the parser should not expect CreationTime to be the last parameter, followed by any specific character.
- 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.
- DirectoryMask - specifies the directory mask.
- Recursive - set this parameter to True to perform a recursive search, i.e., including subdirectories.
- Path - specifies the path to the directory.
Description
Use this method to read contents from the opened directory.
Do not pass the handle to the opened file as
Handle.
In case of error, EElSFTPError exception containing
SFTP error code, is raised.
For more information on error handling, please read the
corresponding how-to article.
ReadDirectory should be called once.
It returns the complete directory contents.
The client must close the handle using the
CloseHandle method.
Use ListDirectory as a simpler alternative to ReadDirectory.
ListDirectory doesn't require you to open and close the directory.
[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