Page 1 of 4

"Search archives" inconsistency

Posted: 2022-07-10, 10:37 UTC
by XPEHOPE3KA
I would consider this a bug but I tested 9.51, 10 and 10.5 versions and they behaved the same so maybe I just don't understand something (or a plugin/setting is involved), but...

TLDR: "Search archives" tick when enabled forces "Find text" tick to only search archives, not "in addition to usual files"
  1. In an empty folder create file "1.txt" with a single string "ssl"
  2. Archive that file to "1.zip"
  3. Open search inside that directory, search for "1.txt", set "Search archives"
  4. Search finds both files (inside and outside the archive)
  5. Enable "Find text", input "ssl" w/o quotes, choose ANSI encoding
  6. Search finds just the archived file, not the usual one
Note that Russian translation translates "Search archives" as "Also search archives" so I think it's meant to always behave as in 4), not in 6). Neither help files seem to specify exceptions for "Find text". Is it possible to fix this so that one can search for text simultaneously inside and outside archives?

Re: "Search archives" inconsistency

Posted: 2022-07-10, 11:47 UTC
by petermad
2XPEHOPE3KA
I cannot reproduce the described - here TC finds both files after performing step 5.

This is how it looks like here with a fresh ini file: https://madsenworld.dk/tcmd/searchtextinarchives.png

Re: "Search archives" inconsistency

Posted: 2022-07-10, 12:07 UTC
by white
Also not confirmed.

Re: "Search archives" inconsistency

Posted: 2022-07-10, 12:42 UTC
by XPEHOPE3KA
2petermad
If I enable Everything like in your screenshot, behavior is as expected. Can you please test like this:
  1. Disable Everything
  2. Close search dialog (to force removing of cached search results)
  3. Perform 3) and 5) from original post

Re: "Search archives" inconsistency

Posted: 2022-07-10, 13:22 UTC
by petermad
2XPEHOPE3KA
I still get the same result - see: https://madsenworld.dk/tcmd/searchtextinarchives2.png

Could you please run this from TC's command line:

Code: Select all

"%COMMANDER_EXE%" /i=%TEMP%\test.ini
and test again.

Re: "Search archives" inconsistency

Posted: 2022-07-10, 14:50 UTC
by XPEHOPE3KA
2petermad
Indeed with clean config everything is Ok. (Although I needed quotes around %COMMANDER_EXE%)

The culprit appeared to be WordArc plugin set up to "txt":

Code: Select all

[PackerPlugins]
txt=400,%APPDATA%\GHISLER\Plugins\WCX\wordarc\wordarc.wcx
[PackerPlugins64]
exts=txt*
If either one of the settings above is missing, txt files are not considered archives for the purpose of searching.

I now think it's a bug in WordArc as its default settings indicate it can search within archives but in this case it doesn't (if one changes search file name to nothing, WordArc should return results from e.g. "1.txt\word_lines.txt" file).
However I'd also like to see it documented in help that enabling "Search archives" stops considering files for plain text search if they are archives according to some WCX.

P.S.: Also I can't reproduce Everything setting influence any longer :shock:

Re: "Search archives" inconsistency

Posted: 2022-07-10, 19:40 UTC
by petermad
2XPEHOPE3KA
Well txt=400,... means that the flag for "Allows searching for text in archives" is set, to make TC aware that the WordArc pluging should be able to search in txt files - but apparantly it is not able to.

Re: "Search archives" inconsistency

Posted: 2022-07-11, 07:24 UTC
by ghisler(Author)
When "search archives" is enabled, then Total Commander will
- search for text in files not recognized as archives
- search for text inside the packed files contained in archives

However, it will not search in the archive files themselves. For example, if a zip file contains a file named
file_name.txt
with content
file_content

Then a search for
Content: file_name
will find the zip when search in archives is unchecked, but not when search in archives is checked.

Re: "Search archives" inconsistency

Posted: 2022-07-11, 10:46 UTC
by mmm
Oh my goodness.

Re: "Search archives" inconsistency

Posted: 2022-07-11, 13:05 UTC
by ghisler(Author)
Sorry, I do not understand your comment.

Re: "Search archives" inconsistency

Posted: 2022-07-11, 16:02 UTC
by Horst.Epp
Christian,
I guess mmm has the same problem as I have with your description.
I just can't understand
"will find the zip when search in archives is unchecked, but not when search in archives is checked"

Re: "Search archives" inconsistency

Posted: 2022-07-11, 16:28 UTC
by XPEHOPE3KA
2Horst.Epp
zip files with unencrypted filenames contain them as is. So to find a zip file containing file "file_name" one can search with "Find text" "file_name" but only when "Search archives" is unchecked - that is one can consider zip files as text files for this.

Re: "Search archives" inconsistency

Posted: 2022-07-11, 16:51 UTC
by Horst.Epp
XPEHOPE3KA wrote: 2022-07-11, 16:28 UTC 2Horst.Epp
zip files with unencrypted filenames contain them as is. So to find a zip file containing file "file_name" one can search with "Find text" "file_name" but only when "Search archives" is unchecked - that is one can consider zip files as text files for this.
Ok, understand now.
But I think the following part of Christians explanation is unnecessary
"with content
file_content"

Re: "Search archives" inconsistency

Posted: 2022-07-11, 20:24 UTC
by petermad
2Horst.Epp
But I think the following part of Christians explanation is unnecessary
"with content
file_content"
That part confused me too at first - since it is not used in the later explained search.

Re: "Search archives" inconsistency

Posted: 2022-07-12, 07:22 UTC
by ghisler(Author)
The point is that when you check "Search archives", then archives are treated like directories. The search text isn't found in the archives themselves, but only in what's inside.