Wildcard search issue

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
pol098
Junior Member
Junior Member
Posts: 62
Joined: 2005-08-03, 15:54 UTC
Location: UK

Wildcard search issue

Post by *pol098 »

This looks like a bug. My TCMD doesn't appear to handle wildcarding in the same way as the basic Windows command processor. Specifically, in a command prompt window
dir /s *.doc?
lists all .doc and .docx files, which is what I expect.

However I find that the TCMD 8.51a search on Win7/32 with *.doc? finds all .docx, but no .doc files (there are plenty). *.doc (without "?") finds .doc, but not .docx, as expected. I suppose something like "*.doc;*.doc?" would work around the issue, but I wouldn't expect to have to do that.

Best wishes.

PS: I might have got this wrong; DIR seems to behave oddly, and I'm not sure what's right. In a directory with a .VMX and a .VMXK file, I find that
DIR *.vmx returns BOTH (which I didn't expect); but
DIR *.VM returns neither (which I do expect). It seems that DIR treats extensions of 4 or more characters (i.e., not possible 8.3 format) differently than shorter extensions. The "?" wildcard doesn't come into this.

So I'm not sure what TCMD should do with *.DOC? Maybe *.doc? should not return files with extension .DOC (although DIR *.DOC? definitely does returns both .DOC and .DOCX, as I said).

I'm sorry if this is confusing, I think it is the topic more than my mode of expression.
Last edited by pol098 on 2014-12-02, 16:28 UTC, edited 1 time in total.
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

From TC's help:
A question mark ? stands for exacly one character, and an asterisk * stands for any number of characters
.

So just use *.doc* in stead of *.doc?

And yes, this is different from Windows' command line behaviour.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
pol098
Junior Member
Junior Member
Posts: 62
Joined: 2005-08-03, 15:54 UTC
Location: UK

Post by *pol098 »

petermad wrote:From TC's help:
A question mark ? stands for exactly one character

So just use *.doc* in stead of *.doc?

And yes, this is different from Windows' command line behaviour.
Thanks, *.doc* does find them all. The "standard" behaviour of DIR is so confusing (see the PS to my original post) that it's not worth any other program trying to follow it. The workaround allows in a few irrelevant files (obviously this is not just for doc[x]) like

c:\Windows\winsxs\Manifests\x86_microsoft-windows-s..docs-main.resources_31bf3856ad364e35_6.1.7600.16385_es-es_636a723ac08eeecf.manifest

Just for curiosity I tried another searcher, UltraSearch, which finds .DOC files with *.doc? Just the way it is, can't be called a bug for either TCMD or US.
User avatar
solid
Power Member
Power Member
Posts: 749
Joined: 2004-08-09, 11:20 UTC

Post by *solid »

That "standard" DIR behavior got changed few times since DOS days, so it cannot be called standard :)
Post Reply