Question

  Asked: Apr 28 2008   4:12 PM GMT
  Asked by: Klw


List Multiple directories during FTP Session


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?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0




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.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Networking.

Looking for relevant Networking Whitepapers? Visit the SearchNetworking.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register