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

Postby HPW » April 30th, 2018, 10:07 am

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
Moderator
 
Posts: 238
Joined: February 25th, 2006, 10:19 am
Location: Germany

Re: TFindFile matches too much ext

Postby Kambiz » May 2nd, 2018, 6:35 am

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
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: TFindFile matches too much ext

Postby HPW » May 2nd, 2018, 6:15 pm

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
Hans-Peter
HPW
Moderator
Moderator
 
Posts: 238
Joined: February 25th, 2006, 10:19 am
Location: Germany

Re: TFindFile matches too much ext

Postby Kambiz » May 3rd, 2018, 9:02 am

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
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: TFindFile matches too much ext

Postby HPW » May 27th, 2018, 7:46 am

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
Moderator
 
Posts: 238
Joined: February 25th, 2006, 10:19 am
Location: Germany

Re: TFindFile matches too much ext

Postby Kambiz » June 24th, 2018, 3:51 pm

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
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 13 guests

cron