Date: Wed, 1 Jul 1998 17:32:09 +0300 (IDT) From: Eli Zaretskii To: Dim Zegebart cc: "djgpp AT delorie DOT com" Subject: Re: Problem porting findfirst() to Linux In-Reply-To: <359A368D.9F2DE084@post.comstar.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Wed, 1 Jul 1998, Dim Zegebart wrote: > I'm porting my DJGPP code to Linux and I'm faced with problem > what findfirst() doesn't exist in Linux libc :( IMHO, you shouldn't have used findfirst in a portable code in the first place. The Posix way to do that is to use opendir/readdir and (if you need more than just a name) stat. If you need to filter the files, use fnmatch to match file names returned by readdir against a wildcard. Another possibility is to use glob and then work on the list of file names it returns. (On Unix, glob will call opendir, readdir and fnmatch internally.)