List

Declaration: TFtpConnection.List (FileMask: string; Details: boolean; FileList: TStringList): integer;
The method List retrieves a list of files or directories in the current or specified directory on the FTP server and stores it in the string list FileList. The parameter FileMask can contain wildcards ('*' and '?'). The parameter Details controls the kind of information retrieved: if Details is FALSE just the list of files and directories are returned, if Details is TRUE server-dependent details including the file size, the date modified, and the file permissions for the Owner, Group, and User are returned.

Please note that in the case that Details is set to TRUE wildcards are not allowed.

The function returns the following error codes:

 0 ... everything is OK
-2 ... file not found
-3 ... cannot read file (access error)
-4 ... wildcards are not allowed íf Details = TRUE
-9 ... unspecified error

Hint 1: Most FTP servers are Unix-based. Thus the path to the file (AFile) normally uses slashes (/) instead of backslashes (\) to separate directories. Failing to use the correct separation character will result in an error (-2).