From: Keith MARSHALL <keith.marshall@to...> - 2004-12-13 10:44:44
> You could use the MS-specific equivalents (_findfirst I think) ...
If Luke is correct about _findfirst as the M$ equivalent, (I don't
know either, because I have never used Borland's compiler, nor looked
at their documentation), then better still (because it is more portable),
you could use the opendir()/readdir()/closedir() functions to get file
names from the directory of interest.
The disadvantage of this is that you would have to do your own pattern
matching -- perhaps not a bad idea, since IMHO, the matching capabilities
of _findfirst()/_findnext are pretty much crippled anyway. If you can
live with the GPL, you might take a look at glob.c (which was written by
Richard Stallman) -- this can be found in the man-1.5m2 tarball
This implements POSIX sytle file name globbing, using the above named
functions to scan directories, and works equally well when compiled with
MinGW, (a few trivial code modifications may be required), as it does on
its intended BSD/Linux/UNIX targets.