delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/12/13:11:24

Date: Sun, 12 Jul 1998 19:40:47 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Laurence Withers <lwithers AT lwithers DOT demon DOT co DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: Portable way to examine a directory?
In-Reply-To: <HZwMmCA8w5p1Ew0U@lwithers.demon.co.uk>
Message-ID: <Pine.SUN.3.91.980712193802.27114a-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019