error finding files

English support forum

Moderators: white, sheep, Hacker, Stefan2

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

error finding files

Post by *pbelon » 2018-05-02, 18:25 UTC

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: 6247
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai » 2018-05-02, 19:02 UTC

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
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

User avatar
sqa_wizard
Power Member
Power Member
Posts: 3381
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard » 2018-05-02, 19:02 UTC

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: 6247
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai » 2018-05-02, 19:08 UTC

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

Regards
Dalai
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

User avatar
sqa_wizard
Power Member
Power Member
Posts: 3381
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard » 2018-05-02, 19:17 UTC

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: 36425
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2018-05-03, 09:01 UTC

The ? currently does not match the dot. Try this instead:
*2*21*3*
Author of Total Commander
http://www.ghisler.com

User avatar
Dalai
Power Member
Power Member
Posts: 6247
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai » 2018-05-03, 14:55 UTC

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
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36425
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2018-05-04, 10:36 UTC

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
http://www.ghisler.com

User avatar
Dalai
Power Member
Power Member
Posts: 6247
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai » 2018-05-04, 14:04 UTC

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
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36425
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2018-05-06, 09:47 UTC

Yes, it would definitely be slower, at least on network drives. But it's unavoidable when using ? placeholder.
Author of Total Commander
http://www.ghisler.com

User avatar
Dalai
Power Member
Power Member
Posts: 6247
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai » 2018-05-06, 14:05 UTC

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
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

User avatar
DrShark
Power Member
Power Member
Posts: 1111
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262

Post by *DrShark » 2018-05-07, 22:28 UTC

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?
Android 4.3.1 no root, kernel 08.09.2016; Vista Home Premium SP2 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36425
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2018-05-08, 09:50 UTC

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
http://www.ghisler.com

User avatar
petermad
Power Member
Power Member
Posts: 8030
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Post by *petermad » 2018-05-08, 22:06 UTC

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
Danish Total Commander Translator
TC 9.21a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit and TC 2.91 on Android 6.0
Get Extended Total Commander Menus | PHSM-Calendar

User avatar
petermad
Power Member
Power Member
Posts: 8030
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Post by *petermad » 2018-05-09, 20:05 UTC

Fixed in TC 9.20b2 :-)
License #524
Danish Total Commander Translator
TC 9.21a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit and TC 2.91 on Android 6.0
Get Extended Total Commander Menus | PHSM-Calendar

Post Reply