I remember, there was a fine set of C functions on PC: _dos_findfirst and _dos_findnext. Names slightly differ from compiler to compiler.

With their help it was very easy to process set of files with names, matching certain criteria.

The way I approached this was by combining the opendir(), readdir(), closedir() APIs with the regular expression APIs regcomp(), regexec(), regfree().

I used this to write wrappers called IFS_opendir(), IFS_readdir(), etc. You call those routines and provide a directory name and a regular expression and they read only the matching filenames from the directory.

I wrote my code in ILE RPG, but there's nothing that stops you from doing the same thing in ILE C.

Mine were written for an article entitlted "IFS Directory Listing with Wildards", and if you have a Pro membership with the iSeries Network, you can read it at the following link:

I wrote a follow-up that created CL wrappers for these same commands so that they could be used easily from a CL program (also requires a Pro membership):

This thread ...


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

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