Article View: borland.public.cppbuilder.nativeapi
Article #9102Re: Find a file in one of subdirectories
From: Andrue Cope [TeamB]
Date: Mon, 02 Aug 2004 13:40
Date: Mon, 02 Aug 2004 13:40
23 lines
1772 bytes
1772 bytes
Mauro wrote: > But what the hell should I do when I have 50 subdirectories > (no further subdirectories are included) in the current > directory. Is there no easy possibility to do that?? Ah yes. The perrenial question that crops up every few months :) You use FindFirst/Next to search for all the objects in a directory and make a note of those that are themselves directories. Then you repeat the search for all directories you noted earlier. It's a recursive algorithm. You continue searching until you've been everywhere, you found what you were looking for or (in the case of badly written implementations) you run out of stack :) Actually the simpler method is to start a new search as soon as you find a child directory but this is dependant on the OS being able to maintain multiple concurrent searches and is a bad idea IMO. -- Andrue Cope [TeamB] [Bicester, Uk] http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID:
<410e445c@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<410e3fb2$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,de3e19de7f81211c X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Andrue Cope [TeamB]" <no.spam@spammy.com> Subject: Re: Find a file in one of subdirectories Newsgroups: borland.public.cppbuilder.nativeapi References: <410e3fb2$1@newsgroups.borland.com> User-Agent: XanaNews/1.16.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 NNTP-Posting-Host: 217.207.223.34 Message-ID: <410e445c@newsgroups.borland.com> Date: 2 Aug 2004 06:40:44 -0700 X-Trace: newsgroups.borland.com 1091454044 217.207.223.34 (2 Aug 2004 06:40:44 -0700) Lines: 23 X-Authenticated-User: acope Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail