Mail Archives: djgpp/1998/04/04/13:47:12
Myknees wrote:
>
> It looks like it should find and show subdirectories, but it shows all the
> files, including the ones whose ff_attrib != FA_DIREC. Confusion. One weird
> thing is that using -1 as the attrib makes the program not output anything.
What you've described is the standard defined behavior of
findfirst()/findnext() according to the libc docs:
Any file that doesn't have any flag bits that aren't specified is
selected for the search. Thus, if you specified `FA_DIREC' and
`FA_LABEL', you would get all subdirectories, the volume label, and
any file that is neither read-only or modified.
Apparently, there's no way to make findfirst() _not_ list all ordinary
files.
However, you said yourself that the value of f.ff_attrib is 16 for
directories and 32 for files; it's simple enough to just ignore any
entries with values other than 16.
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com |
| ICQ UIN#: 7406319 | http://www.cs.com/fighteer/ |
| ObJoke: If Bill Gates were a robber, not only would he |
| shoot you, but he'd send you a bill for the bullets. |
---------------------------------------------------------------------
- Raw text -