× 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.



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:
http://www.iseriesnetwork.com/article.cfm?id=50900

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):
http://www.iseriesnetwork.com/article.cfm?id=50930


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.