TotalCommander Bug?

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC »

Well I tried putting the following line in my wincmd.ini file as suggested

1_detect="ext="DBF" | ext="DBC""

(With the number changed to reflect my DBFView plugin, of course.)

The error I reported previously does not occur (yay!) but now the DBFView plugin doesn't ever appear. I've closed and reloaded TC, rebooted the system, uninstalled/reinstalled the DBFView plugin, tried the detect line in various places in the Lister Plugin section. all to no avail.

No more time for this.
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Do you have a line for the plugin itself, e.g.
1=c:\somedir\pluginname.wlx ?

The two come together.

2norfie
The description is in the lister plugin writer's guide. I use the following to exclude txt and ini files from the hpg_ed viewer:

5_detect="!(ext="TXT" | ext="INI")"

Note that the brace AFTER the not operator "!+ is necessary!

The supported options are quite powerful, you can even filter by file contents to a certain degree, e.g. look for <html> or so.
Last edited by ghisler(Author) on 2003-05-15, 21:43 UTC, edited 1 time in total.
Author of Total Commander
https://www.ghisler.com
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC »

Hi Christian.

I must be slipping not to notice the Bang operator as standing for "not". Now I recognize what is going on.
The supported options are quite powerful, you can even filter by file contents to a certain degree, e.g. look for <html> or so.
Hmmm. Are these options documented someplace I missed?


Thanks!
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Here is the complete documentation from the lister plugin writer's guide:



The syntax of the detection string is as follows. There are operands, operators and functions.
Operands:

EXT The extension of the file to be loaded (always uppercase).
SIZE The size of the file to be loaded.
FORCE 1 if the user chose 'Image/Multimedia' from the menu, 0 otherwise.

MULTIMEDIA 1 if the file would be played or displayed by Total Commander internally. If this flag isn't used in the string, then all Multimedia files are always loaded internally and not passed to the plugin. Requires TC 5.52 or later!
[5] The fifth byte in the file to be loaded. The first 8192 bytes can be checked for a match.
12345 The number 12345
"TEST" The string "TEST"

Operators
& AND. The left AND the right expression must be true (!=0).
| OR: Either the left OR the right expression needs to be true (!=0).
= EQUAL: The left and right expression need to be equal.
!= UNEQUAL: The left and right expression must not be equal.
< SMALLER: The left expression is smaller than the right expression. Comparing a number and a string returns false (0). Booleans are stored as 0 (false) and 1 (true).
> LARGER: The left expression is larger than the right expression.

Functions
() Braces: The expression inside the braces is evaluated as a whole.
!() NOT: The expression inside the braces will be inverted. Note that the braces are necessary!
FIND() The text inside the braces is searched in the first 8192 bytes of the file. Returns 1 for success and 0 for failure.
FINDI() The text inside the braces is searched in the first 8192 bytes of the file. Upper/lowercase is ignored.

Internal handling of variables

Variables can store numbers and strings. Operators can compare numbers with numbers and strings with strings, but not numbers with strings. Exception: A single char can also be compared with a number. Its value is its ANSI character code (e.g. "A"=65). Boolean values of comparisons are stored as 1 (true) and 0 (false).

Examples:

String Interpretation
EXT="WAV" | EXT="AVI" The file may be a Wave or AVI file.

EXT="WAV" & [0]="R" & [1]="I" & [2]="F" & [3]="F" & FIND("WAVEfmt")
Also checks for Wave header "RIFF" and string "WAVEfmt"

EXT="WAV" & (SIZE<1000000 | FORCE) Load wave files smaller than 1000000 bytes at startup/file change, and all wave files if the user explictly chooses 'Image/Multimedia' from the menu.

([0]="P" & [1]="K" & [2]=3 & [3]=4) | ([0]="P" & [1]="K" & [2]=7 & [3]=8)
Checks for the ZIP header PK#3#4 or PK#7#8 (the latter is used for multi-volume zip files).

EXT="TXT" & !(FINDI("<HEAD>") | FINDI("<BODY>")) This plugin handles text files which aren't HTML files. A first detection is done with the <HEAD> and <BODY> tags. If these are not found, a more thorough check may be done in the plugin itself.

MULTIMEDIA & (EXT="WAV" | EXT="MP3") Replace the internal player for WAV and MP3 files (which normally uses Windows Media Player as a plugin). Requires TC 5.52 or later!

Operator precedence:
The strongest operators are =, != < and >, then comes &, and finally |. What does this mean? Example:

expr1="a" & expr2 | expr3<5 & expr4!=b will be evaluated as ((expr1="a") & expr2) | ((expr3<5) & (expr4!="b"))
If in doubt, simply use braces to make the evaluation order clear.
Author of Total Commander
https://www.ghisler.com
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC »

Thank you Christian!

This is powerful stuff.
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
Post Reply