230 pts.
 Command to list files on local system
The command 'ls' would list the files on the remote system, Is there a command to list the files on the local system. I'm trying to tranfer files between IFS using FTP. Thanks

Software/Hardware used:
ASKED: April 6, 2010  8:57 PM
UPDATED: April 7, 2010  1:56 PM

Answer Wiki:
To create a list of local IFS-files into a physical file, follow these steps: 1. Create the file to recieve the filenames: <pre>CRTPF mylib/mydirlist RCDLEN(12) LVLCHK(*NO)</pre> 2. Make the IFS-directory your current directory: <pre>CD '/somedir/myfiledir'</pre> 3. Now use Qshell's ls command to list the filenames into the physical filefrom step 1. <pre>qsh 'ls *.* > /QSYS.lib/mylib.lib/mydirlist.file/mydirlist.mbr'</pre> Wrap all the above coding into a CL-pgm, and you'll have your list available as a physical file. Now write a pgm that 'writes' all needed ftp-steps into a source-file and run ftp using this. You may Google 'ftp batch' to see how, or put a new question. Happy programming DanF
Last Wiki Answer Submitted:  April 7, 2010  1:56 pm  by  DanTheDane   2,540 pts.
All Answer Wiki Contributors:  DanTheDane   2,540 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

None that I’m aware of. I suppose it’s assumed that you know what your files are before entering FTP. However, in the AS/400 FTP client, you could do something like:

 > sysc qsh cmd('ls')

The ls utility could be used to list your current directory. You could also pass a directory path into the ls utility. You could run commands other than QSH if you wanted a list of files in a library or specify the library in path format for the ls utility. If you run QSH inside of a FTP session, you might need to run the QSH exit command rather than <F3> to return to FTP.

Tom

 107,845 pts.