Back to product page
- Introduction
- Overview
- License agreement
- Getting Started
- Objects
- Enumerations
- wodSFTP
- Methods
- Abort
- About
- AppendData
- AppendFile
- Connect
- DeleteFile
- DeleteFiles
- Disconnect
- ExtendedCmd
- GetAttributes
- GetData
- GetDataAt
- GetFile
- GetFileAt
- GetFiles
- ListAttributes
- ListDir
- ListNames
- LoopFiles
- MakeDir
- PutData
- PutDataAt
- PutFile
- PutFileAt
- PutFiles
- RealPath
- RemoteClose
- RemoteOpen
- RemoteRead
- RemoteWrite
- RemoveDir
- Rename
- SetAttributes
- SetAttributes64
- Properties
- Authentication
- Blocking
- BufferSize
- ClientName
- Compression
- Encryption
- EncryptionList
- ErrorText
- Extensions
- FingerPrint
- FIPS
- HMacList
- Hostname
- KeepAlives
- KeyExchangeList
- KeySignatureList
- LastError
- ListItem
- LocalPath
- Login
- MaxTransferRate
- MyHostname
- MyIP
- Notification
- Password
- Port
- PrivateKey
- ProxyHostname
- ProxyLogin
- ProxyPassword
- ProxyPort
- ProxyType
- RemoteIdentification
- RemotePath
- Resume
- ServerErrorCode
- ServerErrorText
- State
- StateText
- Timeout
- Timezone
- TransferMode
- TransferRate
- TransferTime
- UseIPv6
- Version
- Events
- Methods
- IwodSFTPNotify
- SftpItem
- SftpItems
- How to get support?
- Technical information
- Fast notifications interface
- Error list
ListNames method
Lists file and folder names in a directory on the server.
Type
NoneSyntax
- Basic
object.ListNames [RemotePath]
The ListNames(object,RemotePath) syntax has these parts:
The ListNames(object,RemotePath) syntax has these parts:
object | An expression evaluating to an object of type wodSFTP. |
RemotePath | Optional. A Variant value. Full path to a directory on the server. |
Remarks
The ListNames method will send a request to the server to retrieve just the names of files and directories in the specified path. Once the server sends back data, the ListItems event will be fired (possibly more than once!!) containing a list of files sent by the server, each one in 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. You should wait for the Done event to declare the listing as finished.Once completed, the Done event will be fired. If no error occurs, the ErrorCode argument in the Done event will be set to 0 (zero). If an error occurs, the ErrorCode will hold the number of the error and ErrorText will contain a description for the error.
No wildcards can be used for RemotePath argument. The RFC protocol specification for SFTP does not allow them.
To retrieve a full listing of files/directories for a given path (including size, permissions, dates...) you should use the ListDir method. To retrieve the structure of the directory inside an already parsed collection of SftpItem objects, you should use the ListAttributes method.