ListPattern Property Setting can Affect how FTP2 Gets Directory Information

If an FTP server supports the RFC 3659 extension, which includes the MLSD command, then it is automatically known to Chilkat FTP2 because the FTP server’s response to the FEAT command will include MLSD in the list. (Chilkat automatically sends a FEAT command after connecting so that it knows the capabilities of the FTP server.)

When Chilkat FTP2 recognizes that MLSD is supported, it will use this extension whenever possible. The reason is that MLSD returns more accurate date/time and size information. The drawback is that it can only return a full directory listing. Therefore, if the ListPattern property is set to anything other than “*”, such as “*.txt”, then MLSD cannot be used.

When MLSD is not used, Chilkat must use the FTP protocol’s LIST command which returns the directory listing in a human-readable format. The problem with the LIST response is that different operating systems and FTP servers respond with different listing formats. Chilkat FTP2 automatically recognizes and parses all known directory formats, including formats for uncommon systems such as VAX/VMS, MVS, AS/400, etc. Another issue with the human-readable response is that date/time information may be inaccurate (for example, timezone may not be known, or for older files the HH:MM:SS may not be provided).

Therefore, when using FTP2 to examine the contents of a remote directory, if accurate date/time information is important, then make sure the ListPattern is set to “*” and write your application code to iterate over all the files in the remote directory, perhaps only acting on the files that have names matching what your app needs.

Of course, even when using “*”, if the FTP server itself does not support MLSD, then your app is at the mercy of whatever information is or is not included in the human readable directory listing returned by the LIST command.