|
Summary
An OnList event is fired for each item in the directory listing received.
Description
The OnList event occurs once for every matching file or subdirectory, in your current remote directory, specified by the ListDir Method. A directory listing operation is triggered by calling
the ListDir method (or by setting the DirAction property to DIR_ACTION_LIST). OnList events will occur directly after the ListDir method is called (or DirAction property is set) and before the line
of code immediately following is executed.
The Wildcards property can be used to restrict the directory listing to only those files and subdirectories which match a given wildcard.
The format of each directory listing line is controlled by setting the ListType property either to LIST_TYPE_SHORT (or by calling the ShortList method) for short listings or to LIST_TYPE_LONG (or by
calling the LongList method) for long listings. OnList events generated for a short listing will only include the name of a subdirectory or of a file, but long listing lines may include any number of
additional pieces of information. Most servers report the size of a file, the time and date of the last modification and the file attributes in a long listing.
The format of long directory listing entries varies from one FTP server to another. Fields, such as name, size, date and time, may be displayed differently and may not be in the same order. It is up
to the application to interpret the incoming lines. In most cases, the directory entry lines can simply be displayed to the user without any further processing. The format can be parsed using the
Parse() method.
While handling the OnList event, an application should not perform tasks, which have the potential of requiring a lot of time to complete, such as generating a message box. A substantial delay could
cause the underlying protocol to time out and terminate the listing prematurely.
Example
Sub FTPClient_OnList (Entry As String) Listing.AddItem Entry End Sub
|