From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: Searching the path. Date: Tue, 14 Apr 1998 18:26:18 -0400 Organization: Two pounds of chaos and a pinch of salt. Lines: 23 Message-ID: <3533E28A.5C53@cs.com> References: NNTP-Posting-Host: ppp203.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Trent Gamblin wrote: > > Can anyone tell me how I can search the path for a file if it isn't in the > current directory? Also, I know how to get a list of files in a directory > but how can I distinguish between regular files and directories? The library function access() can tell you what flags a given file has, and so can the ff_attrib field of 'struct ffblk' used by findfirst()/findnext(). For path searching, look at the searchpath() function declared in . It mimics the behavior of the Borland function of that name. If you want to convert the code for your own use, it's in src/libc/dos/dir/srchpath.c (you need djlsr201.zip for the library sources). -- --------------------------------------------------------------------- | John M. Aldrich | "A woman is not property, and hus- | | aka Fighteer I | bands who think otherwise are living | | mailto:fighteer AT cs DOT com | in a dreamworld." | | http://www.cs.com/fighteer | - Lazarus Long | ---------------------------------------------------------------------