FTP session

20 pts.
Application development
PC/Windows Connectivity
During an FTP session, prior to issue the GET command to receive files from a remote site to my local server, I need to clear my local directory. Is it possible to delete files from the local server ?? kind of a DEL or MDEL command that would be executed locally instead of the remote side..

Answer Wiki

Thanks. We'll let you know when a new response is added.

Since you’ve FTP’d to an external site, any command you execute from within the FTP session will be executed on that remote site, not locally.

What about using the replace keyword with your get command, so that you wont have multiple files stacking up on you server?

Otherwise I would recommend running a batch job prior to your FTP session that clears all files in the directory.

Discuss This Question: 3  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • astradyne
    A quick question for clarification. Are you FTP'ing from an AS400 to another FTP server (i.e. server to server) or are you foing from a PC client to an AS400 server. On the assumption that you're FTP'ing from an AS/400 to another server I would normally do whatever processing I needed to do to clear down files, libraries, folders, etc, prior to making the connection. However, if you want to do it from inside FTP you can use the SYSCMD command to run a command on your local server. For example, SYSCMD DLTF MYLIB/MYFILE will delete the file named MYFILE from library MYLIB. The SYSCMD command can also be abbreviated to an exclamation mark (!). To find out what commands you can and can't use within your FTP session use the HELP command. On the AS400 you will be able to browse through some fairly extensive help text. Hope it helps Jonathan www.astradyne-uk.com
    370 pointsBadges:
  • JPLamontre
    the ftp command QUOTE is dedicated to execute a command on the local server. Opposite, QUOTE RCMD executes a command on the remote server
    0 pointsBadges:
  • rsp123
    Hi, I would second Johnathan's approach. I have used an exclamation mark("!") to execute iSeries commands from inside a FTP script successfully username password lcd libraryname cd remotefolder get remotefil1.txt lclfile ! CPYF FROMFILE(lclfile) TOFILE(fileA) CRTFILE(*YES) FMTOPT(*NOCHK) quit I have also called RPG programs from inside too w/o issues.
    0 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: