Re: FindFirstFile demo at MVPS

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: MikeD (nobody_at_nowhere.edu)
Date: 09/23/04


Date: Thu, 23 Sep 2004 08:04:29 -0400


"Stu" <saet@steh.szerg> wrote in message
news:eM6Ui2VoEHA.556@tk2msftngp13.phx.gbl...
> http://vbnet.mvps.org/index.html?code/fileapi/recursivefiles_minimal.htm
>
> Is there an easy way to modify this program to find only the first x files
> while still recursing dirs? The more I look at the code the more it is
> confusing me!

Depends what you mean by "the first x files". If you simply mean the first
x number of files found by FindFirst/FindNext, then just yes. Simply keep a
counter and quit searching when you've reached that count. However, I get
the feeling you mean the first x in some sorted manner. In that case, the
answer is no. You'd have to find all files, sort them yourself, and then
take the first x of the sorted list.

Mike