error finding files

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
pbelon
Junior Member
Junior Member
Posts: 2
Joined: 2017-05-25, 14:54 UTC

error finding files

Post by *pbelon »

When you have files with dots, finding files fails.
i.e. files named 2.21.34.jpg, 2.21.38.jpg, 2-21-36.jpg, etc
if you try to find: *2?21?3* does not find anything
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Confirmed. Apparently the issue is that the question mark is not a wildcard for the dot, but finds the dash just fine, i.e. 2-21-36.jpg is found but the other two are not found. If you replace the question mark with an asterisk/star, all files are found.

This is either a bug in TC or a documentation error. The help states "A question mark ? stands for exacly one character [...]" which, to me, means any character, including all special characters like dot, dash and so on; the German help even explicitly states "any character".

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3854
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

You are searching for files without extension.
Try *2?21?3*.jpg or just *2?21?3*.* if you like.
#5767 Personal license
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2sqa_wizard
Nope, that doesn't change anything. The asterisk also matches the extension if possible.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3854
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

Nope, that doesn't change anything
You are right (for the TC internal search).
I use the search with option "Everything" enabled, which works fine.
#5767 Personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The ? currently does not match the dot. Try this instead:
*2*21*3*
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2ghisler(Author)
True, but what about the TC help which doesn't mention this or even states the opposite (German help), respectively? See my post above.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, I found it - it's a bug in Windows function FindFirstFile!

Calling it with search string
c:\some directory\*2?21?3*
does NOT find the file. So the only workaround when using ? placeholders is searching for
c:\some directory\*.*
and do the name matching myself.
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2ghisler(Author)
Wouldn't such change cause a slower search because FindFirstFile returns every file instead of only the matching ones? I imagine that this would make more I/O operations which is especially bad on HDDs. Am I wrong?

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, it would definitely be slower, at least on network drives. But it's unavoidable when using ? placeholder.
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2ghisler(Author)
Well, you could leave the code as is and update the help file instead. Maybe not ideal, but possible. My guess is that it worked in the past and Microsoft changed something in Windows API (FindFirstFile) at some point in time.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

ghisler(Author) wrote:Calling it with search string
c:\some directory\*2?21?3*
does NOT find the file. So the only workaround when using ? placeholders is searching for
c:\some directory\*.*
and do the name matching myself.
Why *.*? Search for *2*21*3* and then do own match won't work?
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

In principle, yes - but it would require a lot of changes: Currently TC supports just two modes: Either it passes the search filter to Windows if it's supported there, or it searches for *.* and makes its own comparison (e.g. when user specifies multiple filters).
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

My guess is that it worked in the past and Microsoft changed something in Windows API (FindFirstFile) at some point in time.
I just checked with Windows XP, with the same result - so if it did work it was a looong time ago.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Fixed in TC 9.20b2 :-)
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply