## TFindFile matches too much ext

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

### TFindFile matches too much ext

Hello Kambiz,

After a longer time I revisited your great components.
This time I have use for your TFindfile. Great component.

But I noticed a small glitch.

For example with your sample programm I try to match *.txt
I my folder are files like:
Test1.txt
Test1.txtinf
Test1.txtold

They are all found.
I would understand when my filter would be *.txt* but that is not the case.
So is it by design that extensions match like this? (Start with)

But strange: *.txti or *txto match nothing.

Regards
Hans-Peter

(Tested on my old WIN XP.)
Hans-Peter
HPW
Moderator

Posts: 236
Joined: February 25th, 2006, 10:19 am
Location: Germany

### Re: TFindFile matches too much ext

Hi Hans-Peter,

I'm glad to see you here again.

It is a bug in the Windows API, which still considers that the maximum extension length is three letters and ignores the rest, like DOS. It seems Microsoft just copied the DOS function and pasted it into Windows. You can check it out by issuing the DIR command in the command prompt.

You can use Criteria.Files.Filters property of the component to workaround the problem. For the proper syntax of the filters, please refer to the readme file.

Cheers,
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

### Re: TFindFile matches too much ext

Hello Kambiz,

Also glad to see you still aktiv. How does the things go for you. I guess not much delphi?

I assume you mean this in your demo's filter tab:

Code: Select all
>*.txt*.*

That does show only the txt-files.
Should I expect performance differences using filters?

Regards
Hans-Peter
Hans-Peter
HPW
Moderator

Posts: 236
Joined: February 25th, 2006, 10:19 am
Location: Germany

### Re: TFindFile matches too much ext

Hi Hans-Peter,

Your filter is correct. There is a little performance penalty, but because the search pattern is already set to *.txt, it is almost nothing.

It is almost 7 years that I didn't write any new code in Delphi.
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

### Re: TFindFile matches too much ext

Helo Kambiz,

>>It is almost 7 years that I didn't write any new code in Delphi.

Long time in IT. What's now your favourite dev-tool?

Regards
Hans-Peter
HPW
Moderator

Posts: 236
Joined: February 25th, 2006, 10:19 am
Location: Germany

### Re: TFindFile matches too much ext

Nowadays I use C# and Visual Studio for the living. Visual Studio is fine, but I really don't enjoy writing code using a managed language.
Kambiz

Kambiz