List Multiple directories during FTP Session

50 pts.
Tags:
FTP
During an FTP session, I need to go to 3 directories on a remote system. I want to list out the contents of the directories for me to use later. I know I can use the DIR (disk command, and it will put the data in *CURLIB/DIROUTPUT.DIROUTPUT, but it is a replacement, not an add, so I can only get one directory listing per FTP session. I don't want to have to end the session, and restart it 3 times. Any suggestions? Am I missing something?
1

Answer Wiki

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

Hi,

What you could do is rename your file between each directory listing. Something like this :-

CD DIR1
DIR (DISK
SYSCMD RNMOBJ OBJ(*CURLIB/DIROUTPUT) OBJTYPE(*FILE) NEWOBJ(DIR1)
CD DIR2
DIR (DISK
SYSCMD RNMOBJ OBJ(*CURLIB/DIROUTPUT) OBJTYPE(*FILE) NEWOBJ(DIR2)
CD DIR3
DIR (DISK
SYSCMD RNMOBJ OBJ(*CURLIB/DIROUTPUT) OBJTYPE(*FILE) NEWOBJ(DIR3)

Then after your FTP session copy all the files into one total file :-

CPYF FROMFILE(*CURLIB/DIR1) TOFILE(*CURLIB/TOTDIR) MBROPT(*REPLACE) CRTFILE(*YES)
CPYF FROMFILE(*CURLIB/DIR2) TOFILE(*CURLIB/TOTDIR) MBROPT(*ADD)
CPYF FROMFILE(*CURLIB/DIR3) TOFILE(*CURLIB/TOTDIR) MBROPT(*ADD)

Regards,

Martin Gilbert.

Discuss This Question: 1  Reply

 
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.
  • Cyberhook
    I have the same problem posted by Klw, but I would like to read the directories names before. For the moment, the solution I have is to do a FTP "dir (disk" for every level I find and add the result in my own file. I wonder if there is a more confortable solution... Thank you
    10 pointsBadges:
    report

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.

Following

Share this item with your network: