Problem in FTP_list

Discussions related to FTPAPI (An FTP client package for RPG programming.) http://www.scottklement.com/ftpapi/
Post Reply
alex.cari
Posts: 1
Joined: Thu Aug 03, 2023 2:37 pm

Problem in FTP_list

Post by alex.cari »

I've encountered problems in the FTP_list function in the *SRVPGM.
Contacting an FTP server with FileZilla on UNIX it gave no problems asking for the file list with "*.TXT"

Code: Select all

eval $Rc = ftp_list($Fd:%trim($FilesTXT):100: %addr($FilesName): $FilesNumber
I'm now testing a new Azure based server where the Filezilla server version is different and no longer accepts the "NLST *.TXT" command. I then corrected the program by passing the parameter to blank:

Code: Select all

eval $Rc = ftp_list($Fd:' ':100: %addr($FilesName): $FilesNumber
This should make me the list of all the files, then the code will read only the "TXT".
With this solution the program goes into TIMW state for about a minute then returns "$RC = -0000000001".
Thanks and sorry for my bad english
Scott Klement
Site Admin
Posts: 719
Joined: Sun Jul 04, 2021 5:12 am

Re: Problem in FTP_list

Post by Scott Klement »

That sounds like it's unable to make a connection to the FTP server to download the files, so it sits there for a minute until it times out, then fails.

This is just a guess because you haven't told us much -- just that there's a delay and then you get -1.

By default, FTPAPI writes diagnostic messages to the job log that show what is going on during the FTP communications. Can you look at these messages in your job log and see what is happening?
Post Reply