Article View: borland.public.cppbuilder.nativeapi
Article #3569Re: Behaviour if Findfirst/Findnext
From: Ed Mulroy
Date: Tue, 30 May 2006 12:26
Date: Tue, 30 May 2006 12:26
48 lines
2440 bytes
2440 bytes
> ...handles being open concurrently. Such handles can
> be quite resource intensive and some OSes can't
> tolerate large numbers being left open. ...
FWIW:
I used to routinely do the recursive search into lower directories as you
show in your warning.
I have been totally destroyed by too many open file search handles under
Win95/98, NT version <= 3.51 or when searching on a Novell system. The
worst ones were Novell and when networked with NT. Occasionally everyone on
the network would lock up!
. Ed
> Andrue Cope wrote in message
> news:447bfaec@newsgroups.borland.com...
> Jos� wrote:
>
> 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.
Technical Details
Message-ID:
<447c3ac4$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.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> <447bfaec@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,57df08767886389 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII From: "Ed Mulroy" <dont_email_me@bitbuc.ket> Newsgroups: borland.public.cppbuilder.nativeapi References: <5v4b725541pgl6mgme0m2sc5n0ni1bm94p@4ax.com> <4475d95a$1@newsgroups.borland.com> <4476b4cf$1@newsgroups.borland.com> <eb1h725gvftrf3h95vhrn1pjfu4fjgd3gs@4ax.com> <447bfaec@newsgroups.borland.com> Subject: Re: Behaviour if Findfirst/Findnext Date: Tue, 30 May 2006 08:26:54 -0400 Lines: 50 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 69.242.35.97 Message-ID: <447c3ac4$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1148992196 69.242.35.97 (30 May 2006 05:29:56 -0700) X-Authenticated-User: edmulroy Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.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