Command to list files on local system

240 pts.
Tags:
AS/400
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

Answer Wiki

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

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

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    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
    125,585 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following