Article View: borland.public.cppbuilder.nativeapi
Article #3568Re: Behaviour if Findfirst/Findnext
From: Andrue Cope [TeamB]
Date: Tue, 30 May 2006 07:57
Date: Tue, 30 May 2006 07:57
37 lines
1903 bytes
1903 bytes
Jos� wrote:
> This probably means that the behviour of findfirst/findnext cannot be
> predicted.
Aye. There is one other difference that can trip people up. The
standard directory search algorithm is:
Find_First
do
{
if( last_found__is_Dir )
recurse_to_search_dir
}while( More_to_find
The problem with this is that it leads to multiple directory search
handles being open concurrently. Such handles can be quite resource
intensive and some OSes can't tolerate large numbers being left open.
As a result I feel it is better to use this algorithm:
Find_First
do
{
if( last_found__is_Dir )
add_dir_to_list
}while( More_to_find
search_each_dir_in_dir_list
This way only one search is active at a time.
--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID:
<447bfaec@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<5v4b725541pgl6mgme0m2sc5n0ni1bm94p@4ax.com> <4475d95a$1@newsgroups.borland.com> <4476b4cf$1@newsgroups.borland.com> <eb1h725gvftrf3h95vhrn1pjfu4fjgd3gs@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,57df08767886389 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII From: "Andrue Cope [TeamB]" <no.spam@not.a.valid.address> Subject: Re: Behaviour if Findfirst/Findnext Newsgroups: borland.public.cppbuilder.nativeapi References: <5v4b725541pgl6mgme0m2sc5n0ni1bm94p@4ax.com> <4475d95a$1@newsgroups.borland.com> <4476b4cf$1@newsgroups.borland.com> <eb1h725gvftrf3h95vhrn1pjfu4fjgd3gs@4ax.com> Date: Tue, 30 May 2006 08:57:33 +0100 User-Agent: XanaNews/1.18.1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 217.207.223.34 Message-ID: <447bfaec@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1148975852 217.207.223.34 (30 May 2006 00:57:32 -0700) Lines: 37 X-Authenticated-User: acope Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail