Mail Archives: djgpp/1998/04/14/19:33:17
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
<dir.h>. 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 |
---------------------------------------------------------------------
- Raw text -