Mail Archives: djgpp/1998/07/12/13:11:24
On Sat, 11 Jul 1998, Laurence Withers wrote:
> I'm working on a project which needs to examine a directory.
> Specifically, I have the directory name and I want to search for all
> files ending *.olf, and I also want to search for all subdirectories.
Two possibilities:
1) Use the library function `glob'. It is Posix, so most Unix
system will have it.
2) Use library functions `opendir' and `readdir' to read all the
file names in a directory, then pass them to `fnmatch' to see whether the
file name matches the wildcard. These functions are also Posix, but
`opendir' and `readdir' are usually available on DOS compilers also.
- Raw text -