View previous topic :: View next topic
|
Author |
Message |
vd120
New User
Joined: 06 Nov 2010 Posts: 24 Location: NYC
|
|
|
|
Hello,
I need to get directory file list from the server I'm connecting to via FTP session. When I use Dir *.txt command I can see all the files in the folder on the screen, but when I try Dir *.txt > file_name.txt it is not working. Can you tell if this is possible? My task is to bring list of files from the folder to the mainframe for furser processing.
Thank you. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
well, you have not told us much.
you do realize that file_name.txt will reside on the pc in whatever folder your ftp session set. you will need to transfer the file (get?) to the mainframe after creating it with your dir command. don't know if you can do it in the same ftp session, but probably.
there are others on the board who are more versed in ftp that I and can give you pointers if the want. |
|
Back to top |
|
|
vd120
New User
Joined: 06 Nov 2010 Posts: 24 Location: NYC
|
|
|
|
Yes, I understand this and ready to get file (in the same step on next one). Problem to create file itself. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
The syntax for the FTP DIR command is DIR followed optionally by directory/file name followed optionally by (DISK. Notice that you cannot use redirection such as you attempted.
Your best bet is to use DIR *.TXT (DISK and this will create a file named Use [URL] BBCode for External Links under your TSO user id; this file will contain the directory listing.
This is easily found in section 5.18 of the Communications Server: IP User's Guide and Commands manual, which is located on the IBM web site. Why did you not look it up for yourself? |
|
Back to top |
|
|
vd120
New User
Joined: 06 Nov 2010 Posts: 24 Location: NYC
|
|
|
|
I looked in the different manual and did not find it. Thank you, look like it may work for me. Any chance do you know what would be high level qualifier for Use [URL] BBCode for External Links when jcl will be submitted by TWS scheduler? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
If there's a USER on the job card, then it'll be whatever that USER is. If not, it'll be whatever default user id is assigned by TWS -- and since we're not running TWS here, I have no idea what that would be. That may be a question for your site support group.
Personally, I'd put a USER on the job card to ensure I know where the directory listing goes! |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
Be careful with this too. The format of the directory list can change based on the server you are talking to. It can even change if the same server gets upgraded.
So make your directory parsing routine flexible and make sure it checks for valid data. |
|
Back to top |
|
|
vd120
New User
Joined: 06 Nov 2010 Posts: 24 Location: NYC
|
|
|
|
Thank you. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
That's why I prefer LIST to DIR. Depends on what details you need, though. |
|
Back to top |
|
|
|