Back to product page

ListAttributes method


Lists the contents of a directory as a structure.

Type

None

Syntax

  • Basic
object.ListAttributes [RemotePath]
The ListAttributes(object,RemotePath) syntax has these parts:
objectAn expression evaluating to an object of type wodSFTP.
RemotePathOptional. A Variant value. Full path to the directory on the server.

Remarks

The ListAttributes method will send a request to the server to retrieve the complete directory structure in a collection of SftpItem objects, rather than a line-by-line listing that needs to be parsed. As a result of calling this method, the AttributesData event will fire (possibly more than once if there are many files in the directory), where you can access each item's Name and Permissions etc..

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 the 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 get just names, you can use ListNames.

Platforms

Windows