Internet Direct (Indy) Version 9.0.2 Beta
TIdFTPServer.OnListDirectory
Allows the server to generate a formatted directory listing.

property OnListDirectory: TOnListDirectoryEvent;
Description
OnListDirectory is a TOnListDirectoryEvent property that represents the event handler signalled when an FTP server implementation needs to prepare and process a directory listing for the client connection. OnListDirectory is triggered when the command event handler for the FTP LIST command verb is executed.

OnListDirectoryEvent allows the server to examine, validate, or maintain items that appear in the directory listing using the TIdFTPListItems.ListFormat as indicated by EmulateSystem.

OnListDirectoryEvent allows the server to use properties from the connection for the client thread specified in ASender, the current directory in APath, and the collection with file information in ADirectoryListing. The event handler can also add or delete TIdFTPListItem entries in ADirectoryListing. Use the platform-specific API calls needed to retrieve the list of files for the specified directory, and populate the contents of ADirectoryListing.

An FTP server implementation must assign a procedure to the event handler for the TOnListDirectoryEvent event to allow responding to the event notification. When a procedure has not been assigned to the event handler, an EIdTFTPException will be raised.