Search for non-empty files or folders contains empty result

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

EMathews3
Bronze Member
Bronze Member
Posts: 100
Joined: 2014 Aug 23, 12:54

Search for non-empty files or folders contains empty result

Post by EMathews3 »

Using Ctrl+F Find, no results come back. Regardless of what setup happens in the dialog box, the scrap container is always empty, and the MsgBox says "No items match the specified filter". This started one day and has not stopped. What could be wrong?
Correction: Now searched using a Predefined rule-set, which worked. Then searched *.*, and it seems to be working again as expected. Duhhh.
xp2 5.4.x Ult
Kilmatead
Platinum Member
Platinum Member
Posts: 4842
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Re: Search for non-empty files or folders contains empty result

Post by Kilmatead »

EMathews3 wrote: 2025 Apr 25, 18:11 Duhhh.
I once set the "fuzzy" thingy to 0 to activate regex-mode (which the dialogue then "helpfully" saved), and it took me 2 days of completely nonsensical results to figure out what happened and how I broke it. I mean, who looks at that setting, despite it being right under my nose?
Steely Dan wrote:'Rikki Don't Lose That Number'
It's always the little things that make you want to cry, throw it all out the window, give up and just become a hobo. :wink:

Incidentally, and I don't recall the full reasoning behind it, but the recommended "match-all" string is actually *? instead of *.* as fgagnon pointed out some 16 years ago, now. Just a wee bit o' trivia. :shrug: Fred was always good at that searchy-stuff.
User avatar
nikos
Site Admin
Site Admin
Posts: 16344
Joined: 2002 Feb 07, 15:57
Location: UK

Re: Search for non-empty files or folders contains empty result

Post by nikos »

when in doubt click on CLEAR button then start with your filter definition
or switch the dialog to simple mode (a v6 feature) that has very few options and is simpler to use
Tuxman
Platinum Member
Platinum Member
Posts: 1708
Joined: 2009 Aug 19, 07:49

Re: Search for non-empty files or folders contains empty result

Post by Tuxman »

Kilmatead wrote: 2025 Apr 25, 20:37 Incidentally, and I don't recall the full reasoning behind it, but the recommended "match-all" string is actually *? instead of *.* as fgagnon pointed out some 16 years ago, now.
*? covers a file named "README". *.* does not cover a file named "README". That's the whole point, I guess.
I'm not entirely sure how "*?" makes sense outside a regular expression though - "*" should be enough.
User avatar
nikos
Site Admin
Site Admin
Posts: 16344
Joined: 2002 Feb 07, 15:57
Location: UK

Re: Search for non-empty files or folders contains empty result

Post by nikos »

the reason for this klutz is that xplorer2 removes any solitary * found in NAMED, so you trick it with *?
Kilmatead
Platinum Member
Platinum Member
Posts: 4842
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Re: Search for non-empty files or folders contains empty result

Post by Kilmatead »

Lord knows I scorn the abusive world of commerce for the fantastic scam that it is, but I'm pretty sure there's some kind of obscure statute in the businessman's rule-book that says you're probably not supposed to use words like "klutz" and "trick" with regard to your own product. :D
User avatar
johngalt
Gold Member
Gold Member
Posts: 653
Joined: 2008 Feb 10, 19:41
Location: 3rd Rock

Re: Search for non-empty files or folders contains empty result

Post by johngalt »

Tuxman wrote: 2025 Apr 26, 14:18
Kilmatead wrote: 2025 Apr 25, 20:37 Incidentally, and I don't recall the full reasoning behind it, but the recommended "match-all" string is actually *? instead of *.* as fgagnon pointed out some 16 years ago, now.
*? covers a file named "README". *.* does not cover a file named "README". That's the whole point, I guess.
I'm not entirely sure how "*?" makes sense outside a regular expression though - "*" should be enough.
Interesting. *.* should, theoretically, cover that. .* should indicate all files with an extension, even those without one. But, apparently, null values don't count for .*, huh?

Weird.
Image
Tuxman
Platinum Member
Platinum Member
Posts: 1708
Joined: 2009 Aug 19, 07:49

Re: Search for non-empty files or folders contains empty result

Post by Tuxman »

nikos wrote: 2025 Apr 26, 15:03 the reason for this klutz is that xplorer2 removes any solitary * found in NAMED
Why?
User avatar
nikos
Site Admin
Site Admin
Posts: 16344
Joined: 2002 Feb 07, 15:57
Location: UK

Re: Search for non-empty files or folders contains empty result

Post by nikos »

for why am i in this prison put :P
Kilmatead
Platinum Member
Platinum Member
Posts: 4842
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Re: Search for non-empty files or folders contains empty result

Post by Kilmatead »

You know you're in trouble when Nikos starts quoting Jim Jarmusch... (on a Tom Waits bender this month, are we?)
Down by Law wrote:Zack: For why are you in this prison put?
Roberto: Me? I killed a man.
Zack: You killed a man, huh? What'd you do that for, Bob? The guy didn't like Walt Whitman?
Roberto: I never ask-a to dis man if he like-a de Walt Whitman.
Sweaty-toothed Madmen aside, it's crazy difficult to do this sort of thing without resorting to regex... or the dreaded recursion logic...

Code: Select all

BOOL MatchSpecW(LPWSTR Tame, LPWSTR Wild) {
	while (*Wild) {
		switch (*Wild) {
			case L'?' :
				if (!(*Tame)) return FALSE;

				++Tame;
				++Wild;

				break;

			case L'*' :
				if (MatchSpecW(Tame, Wild + 1)) return TRUE;
				if (*Tame && MatchSpecW(Tame + 1, Wild)) return TRUE;

				return FALSE;

			default :
				if (towlower(*Tame++) != towlower(*Wild++)) return FALSE;

				break;
		}
	}

	return !(*Tame) && !(*Wild);
}
Of course, it would never dawn on Nikos, Zack, or Roberto to just... umm... not delete the lone asterisk? Or, <gasp!>, silently replace it with the kludge itself, and just match everything. :shrug:
User avatar
nikos
Site Admin
Site Admin
Posts: 16344
Joined: 2002 Feb 07, 15:57
Location: UK

Re: Search for non-empty files or folders contains empty result

Post by nikos »

:thumbup: for jarmush

as for the * it is called "sanitizing the input"; 4 y are u to keep something that does nothing, same as an empty box?
Kilmatead
Platinum Member
Platinum Member
Posts: 4842
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Re: Search for non-empty files or folders contains empty result

Post by Kilmatead »

nikos wrote: 2025 Apr 28, 06:18y are u to keep something that does nothing
You can call it whatever you like, but it doesn't "do nothing" - I would safely imagine that 99.9% of users would suggest (and expect) it to match everything, as it most certainly would in almost every other programme in the Windows milieu.

If, computationally-speaking, it is an empty box, then it's your job to make it "just work" anyway, no?

Live the paradox daddy-o, sometimes you gotta do what's wrong in order to do what's right.

(And yes, I appreciate the irony in that logic - if I'm walking down a scary back-alley and I "expect" a serial-killer to jump out and live up to his occupation, then that's just my fault for having poor expectations, but it doesn't negate them - despite the killer negating me. :wink:)
User avatar
nikos
Site Admin
Site Admin
Posts: 16344
Joined: 2002 Feb 07, 15:57
Location: UK

Re: Search for non-empty files or folders contains empty result

Post by nikos »

ai skreama, you skreama, we all skreama.... for ais kreama ;)
Kilmatead
Platinum Member
Platinum Member
Posts: 4842
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Re: Search for non-empty files or folders contains empty result

Post by Kilmatead »

nikos wrote: 2025 Apr 28, 06:18 same as an empty box?
Ok, as you seem to be gobbling up the little yellow pills today, I'll put it another way: Before a search, one could say you're in front of Schrödinger's Box where a blank search is the equivalent of being both empty and yet containing (the potential of) all objects at the same time. We won't know until we see the results - if I see no results, I might erroneously believe it to be empty, yet I know that '*' will match even the atoms in the apparently empty space. Where are my atoms?

Invert your expectations. :wink:

Image
User avatar
johngalt
Gold Member
Gold Member
Posts: 653
Joined: 2008 Feb 10, 19:41
Location: 3rd Rock

Re: Search for non-empty files or folders contains empty result

Post by johngalt »

Or, to put it more another way:

Create two files in a directory, one with an extension and the other without.

Windows CMD processor finds both files regardless of if you run

Code: Select all

dir
,

Code: Select all

dir *
or

Code: Select all

dir *.*
:shock:
Image