[fpc-pascal] Getting strange FTP error using Indy 10 idFTP

Bo Berglund bo.berglund at gmail.com
Thu Nov 23 12:27:09 CET 2017


On Thu, 23 Nov 2017 10:13:14 +0100, Bo Berglund
<bo.berglund at gmail.com> wrote:

>On Thu, 23 Nov 2017 00:09:36 +0100, Bo Berglund
><bo.berglund at gmail.com> wrote:
>
>>I need to get a list of the files that match a specific format like:
>><name>_<date>.zip
>>I could of course traverse the supplied TStrings and look at the first
>>char (discard all d entries) and check if the last part is .zip.
>>But it would be a lot easier if the list could be limited to the
>>filenames only.
>
>In fact the windows7 command line ftp client can do this:
>
>ftp> ls CVS*.zip
>200 PORT command successful.
>150 Opening ASCII mode data connection for file list.
>CVS_Config_2017-09-28.zip
>226 Transfer complete.
>
>Is there a corresponding way for IdFTP to perform a wildcard list and
>returning just the matching files?

For completeness:
-----------------
I received help on the Embarcadero forum which is back on-line, and
the following command does what I need:

FTP.List('CVS*.zip', false);

The first argument is a file name specifier string including wildcard
* and the second is a flag to supply full information (true) or only
the file names (false).
With this in place my utility works and the code is now much cleaner.


-- 
Bo Berglund
Developer in Sweden




More information about the fpc-pascal mailing list