Page 1 of 1

TFindFile matches too much ext

PostPosted: April 30th, 2018, 10:07 am
by HPW
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.)

Re: TFindFile matches too much ext

PostPosted: May 2nd, 2018, 6:35 am
by Kambiz
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,

Re: TFindFile matches too much ext

PostPosted: May 2nd, 2018, 6:15 pm
by HPW
Hello Kambiz,

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

Thanks for your hint about that bug.

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

Re: TFindFile matches too much ext

PostPosted: May 3rd, 2018, 9:02 am
by Kambiz
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. :)

Re: TFindFile matches too much ext

PostPosted: May 27th, 2018, 7:46 am
by HPW
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

Re: TFindFile matches too much ext

PostPosted: June 24th, 2018, 3:51 pm
by Kambiz
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. :)