On Wed, 2004-03-03 at 01:24, rbb@rkbloom.net wrote: > Quoting Sander Striker : > > > On Tue, 2004-03-02 at 19:13, rbb@rkbloom.net wrote: > > > I need a way to expand a wildcard string within a program. Normally I > > would use > > > glob for this, but since I am mainly working on Windows, that won't work. > > So, I > > > would like to suggest apr_file_glob as a adjunct to apr_fnmatch. Assuming > > there > > > are no arguments against this, I will work up a patch over the next few > > days for > > > Windows and possibly Unix. > > > > You may want to look at the implementation in Subversion. Usually there > > is no problem getting common code integrated back into APR. > > I am looking in subversion right now, and the only function that I can see > quickly is svn_cstring_match_glob_list, which is close, but isn't really what I > want. This function takes a glob string a list of strings to match against. > What I want is a function that takes a glob string and a directory name, and > returns a list of all of the files in that directory that match the glob string. > > Am I missing the subversion function you are talking about? Or do I need to > write what I want. I agree that what you have pointed me at is a good first > step, but it is kind of backwards, because it is forcing me to find all of the > files in the directory and then weed out the ones I don't want. Agreed. It would have been nice to have two functions there: match_glob and match_glob_list. The latter could call on the first. Seems like a refactoring job ;). Sander