Problem solve Get help with specific problems with your technologies, process and projects.

FTPing from RPG

This user is looking for a way to verify that a file exists on an FTP server from within an RPG program. Site expert Shahar Mor offers some advice.

Is there a way to verify that a file exists on an FTP server from within an RPG program? We can run a "DIR" command on the FTP directory and take apart its content but that it's very time consuming. We are looking to simply verify that a file exists or does not, and use that exist state as a trigger.
My assumption is that the FTP server is not on the iSeries. You will need to connect to this server in order to check existence (or better use QNTC support).

IF FTP is the only "road" to the remote server you should connect via the iSeries FTP client and then issue command ls Filename (*disk - this will create outputfile lsoutput with 1 record (if file found) or zero (if not found).


Visit the ITKnowledge Exchange and get answers to your connectivity questions fast.

The Best Web Links: Tips, tutorials and more.

PC/Windows connectivity expert Shahar Mor is available to answer your toughest networking questions. Ask Shahar a question or read his previously answered questions here.

Dig Deeper on FTP

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.