Date: Sun, 12 Jul 1998 19:40:47 +0300 (IDT) From: Eli Zaretskii To: Laurence Withers cc: djgpp AT delorie DOT com Subject: Re: Portable way to examine a directory? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.