× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



There are two ways that I know of to do this.

  1) The opendir(), readdir(), etc APIs can be used to read through
         a directory in a program.   Then, you could write whatever
         you wanted to any file that you wanted...

         e.g. call opendir() with the directory you want to list,
              then call readdir() in a loop.   Write the results
              directly in your XML format, or whatever you like.

  2) You could use QSHELL to send the list to a file, and then you
         could read that file in a program and reformat the data
         into XML or whatever.

         e.g. do a STRQSH CMD('cd /somedir/somewhere; ls>/path/to/outfile.txt')
         then read /path/to/outfile.txt to generate your XML or what
         ever you want to do.


Option #1 is a little more complicated, but doesn't require QShell to
be installed, and runs a lot quicker, eliminates the need for a temporary
file, etc.

Here's an RPG IV example from the archives:
   http://archive.midrange.com/midrange-l/200201/msg00449.html

On Wed, 5 Jun 2002 JOberholtzer@compures.com wrote:

> Folks:
>
> I need to merge all the files that reside in a specific named IFS directory
> into one single file.  The merged file can be in the IFS, or it can be
> DB/2, either will work.  The data contained in these files is XML commands.
> I would use DSPLNK if the output went to an outfile, but I can't figure out
> how to get a list of the files to copy, or find a command that will use
> wild cards to accomplish the task.  Any Ideas?
>
> Jim Oberholtzer
>



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2024 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.