×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Then you can keep it simple with something like this, after you create the outfile or add a member to one -

qsh cmd('ls -A1 /your/path > /qsys.lib, etc.')

Then read the outfile in your RPG - ba-da-bing!

If the files will always have the same extension, you can use wildcards, as here - I'll use xml as the extension -

qsh cmd('ls -A1 /your/path/*.xml > etc.')

If you have more than one extension, run the qsh command for each additional one and use >> to ADD to the outfile.

Good luck
Vern

On 8/5/2014 4:55 PM, Buddy McClean wrote:
Thanks,
Actually I will be doing it for a known directory in the root.

Vernon Hamberg <vhamberg@xxxxxxxxxxxxxxx> 8/5/2014 4:44 PM >>>
Hi

If you need only the contents of the root, then you can use the ls
command in QShell and redirect output to a PF. The PF has to be a flat
file member or a source file member.

In CL, first create the PF, then run the QSH command -

CRTPF YOURLIB/YOURFILE RCDLEN(256)

QSH CMD('ls -A1 / > /qsys.lib/yourlib.lib/yourfile.file/yourfile.mbr')

That will put each file and directory on each line, including those with
a dot in the first position.

If you make the options value be -AF1, then the last character of the
names will tell you if the name is a directory or regular file or some
other kind of thing - look up the ls function in QShell documentation -
I forget.

There's a way to tell it to go down through subdirectories, but you
don't want to do that from the root, right?

HTH
Vern

On 8/5/2014 3:51 PM, Buddy McClean wrote:
Good Day,
What is the simplest way ( even if cumbersome ) to get/create a list of filenames contained in an IFS root directory, to be used as input by an ILE program. A batch program.
FTP is putting files in a directory and I want to know the name so I can read via xml-into.
Thanks


This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.