I'll start out by saying that I'm well aware of how FindFirst/FindNext work, so that's really not an issue. The question I did have was this: How does everyone generally deal with the (what would seem to be) inconsistent output that these functions generate? For example, with a initial call of
I get 7 of the 9 directories I expected back. The other 2 not returned had "Hidden" attributes on them - I would expect all directories to be returned, logically, with this call. But to go on, I get 4 files with only the archive flag set on them.
I can't say if I know if the behavior of this call has changed over time (it's been this way since Turbo Pascal), but it doesn't seem to make any logical sense. Personally, I just use faAnyFile in the second parm and post-filter the files myself for whatever attributes I'm wanting in the return output. But that seems like duplicated work that logically should be handled by this routine...
So what do you all do to handle this? Or has this call been changed to actually work in a logical way?
Code:
FindFirst('C:\*.*', faDirectory, sr);
I get 7 of the 9 directories I expected back. The other 2 not returned had "Hidden" attributes on them - I would expect all directories to be returned, logically, with this call. But to go on, I get 4 files with only the archive flag set on them.
I can't say if I know if the behavior of this call has changed over time (it's been this way since Turbo Pascal), but it doesn't seem to make any logical sense. Personally, I just use faAnyFile in the second parm and post-filter the files myself for whatever attributes I'm wanting in the return output. But that seems like duplicated work that logically should be handled by this routine...
So what do you all do to handle this? Or has this call been changed to actually work in a logical way?