Topic Path: Symbol Reference > Classes > TIdFTP Class > TIdFTP Properties > DirectoryListing Property
TIdFTP.DirectoryListing Property

Container for a structured file and directory listing.

property DirectoryListing: TIdFTPListItems;

DirectoryListing is a read-only TIdFTPListItems property that implements a container for TIdFTPListItem instances created from the result values for the List or Status methods. 

DirectoryListing provides a structured means of accessing data about files and directories returned from the FTP LIST, NLST, MLST, MLSD, or STAT commands. 

Items stored in the DirectoryListing container are always cleared prior to adding the values returned by the List or Status methods, or following use of the Reinitialize method. 

Accessing values in the DirectoryListing property causes the DirectoryListing property to be initialized (if it has not previously been assigned), and triggers the OnCreateFTPList event handler to indicate the condition. 

In addition, accessing values the DirectoryListing property causes the textual directory listing to be parsed into its corresponding structured form. 

Traditionally, the FTP protocol did not specify a standardized format for file and directory listings in FTP server implementations. This was done to isolate file system dependencies on the FTP server, and probably contributed to the wide-spread acceptance and implementation of the FTP protocol. But this approach also creates problems when we wish to use automated programs for processing files and directories using the FTP protocol. 

In recent years, enhancements have been proposed for the FTP protocol that allow for consistent yet extensible approach to directory and file listing formats. This has been implemented using the FTP FEAT command, and its corresponding MLST and MLSD features. 

The Indy library includes support for the MLST and MLSD features, but also provides additional support for the defacto standard directory listing formats. 

Additional parsers are available that recognize the defacto directory listing formats used in approximately 30 different platforms and operating systems. To include additional parsers for listing formats, the unit containing the parser must be added to the project containing the FTP client. Each parser is automatically registered in the initialization section for the unit. Include the IdAllFTPListParsers.pas unit in your application to force all known FTP directory listing parsers to be included and registered. 

Accessing values stored in DirectoryListing also causes the textual values in ListResult to be parsed using the capabilities of the registered parsers for the FTP client. By default, the NLST and MLST directory listing formats are registered for TIdFTP

Use ExtListDir and ExtListItem to access directory or file listings specifically generated using the FTP MLST or MLSD commands. 

Use ListParserClass to access the class reference used to parse the directory format based on values updated in the CheckListParseCapa function. 

Use DirFormat to access the identifier for the listing format detected while parsing the directory or file listing. 

DirectoryListing can also be used in application code to populate GUI controls, like TTreeView or TListView, that display the results of an FTP directory operation.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.