Hi wmusers! I needed some advice on a FTP client problem.
I have a custom FTP client to pickup files from specified directories on multiple remote partner FTP servers. The code looks simple enough:
INVOKE pub.client.ftp:ls (returns list of files in output 'dirlist' variable) LOOP (loop over returned 'dirlist') INVOKE pub.client.ftp:get (retrieve each entry)
The problem is some remote partners have some subdirectory under their specified ‘remote-pickup’ directory. The list of files returned by ‘pub.client.ftp:ls’ does not distinguish files from directories. A remote directory looks just like a filename and ‘pub.client.ftp:get’ throws an exception trying to retrieve a directory.
Any thoughts on how to workaround this problem?
There is a ‘pub.client.ftp:dir’ command that returns additional information but the format seems dependent on the remote FTP server.