Article View: borland.public.cppbuilder.nativeapi
Article #167Re: extended file search
From: Helmut Giese
Date: Mon, 30 Jun 2008 15:34
Date: Mon, 30 Jun 2008 15:34
27 lines
1995 bytes
1995 bytes
On Mon, 30 Jun 2008 15:28:19 +0200, S�ren Zimmermann <soeren.zimmermann@sef-softec.de> wrote: Hi S�ren, >Of course I could use FindFirstFile/FindNextFile, but then I will only >get a list of files matching my include files. How can I filter out my >exclude files, esp. when they contain wildcards? I think you will have to use FindFirstFile/FindNextFile (or some higher level component which will use these functions internally). Here's how I would do it if I wouldn't want to think too hard about it: Step 1) Build a list containing all _excluded_ files. That is use FindFirstFile/FindNextFile on all "patterns to exclude". Step 2) Run FindFirstFile/FindNextFile for each pattern you want included. If any file is part of the list built in step (1), ignore it, else delete it. Regarding performance it is probably faster to - get a list of _all_ files and then for each of them - check if it matches an 'exclude file' (if so continue) or - if it matches an 'include file' But it's more programming work, so I'd start out with the easy way outlined above HTH Helmut Giese
Technical Details
Message-ID:
<7nuh64tsvmdrpk3fn7qrtk6362rbbedqor@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.isoc.lu!newsgroups.borland.com!not-for-mailReferences:
<4868dffe$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6bc3b3cc44e0a25 X-Google-Attributes: gid10cc67,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII From: Helmut Giese <hgiese@ratiosoft.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: extended file search Date: Mon, 30 Jun 2008 17:34:24 +0200 Message-ID: <7nuh64tsvmdrpk3fn7qrtk6362rbbedqor@4ax.com> References: <4868dffe$1@newsgroups.borland.com> X-Newsreader: Forte Free Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 91.37.125.200 X-Trace: newsgroups.borland.com 1214839851 91.37.125.200 (30 Jun 2008 08:30:51 -0700) Lines: 27 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.isoc.lu!newsgroups.borland.com!not-for-mail