-File search: Incorrect match with dot ('.')

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
Asperamanca
Junior Member
Junior Member
Posts: 22
Joined: 2005-03-28, 12:50 UTC

-File search: Incorrect match with dot ('.')

Post by *Asperamanca »

In a folder tree, I have of files named
a.cpp
b.cpp
c.cpp
and some files named
a.cpp.a9394
b.cpp.b956

I attempt to find the latter by using file search with the following search term:

*.cpp.*

Expected result:
a.cpp.a9394
b.cpp.b956

Actual result:
a.cpp
b.cpp
c.cpp
a.cpp.a9394
b.cpp.b956

Edit: Also observed in version 7.50a
Last edited by Asperamanca on 2014-03-18, 13:47 UTC, edited 2 times in total.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

You can use *.cpp.?* (i.e. with at least one character after last dot) for now, but it is interesting why *.cpp.* selects a.cpp.
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, Asperamanca.

I can reproduce your problem.
In the folder ~/Downloads/tmp some files named a.cpp b.cpp c.cpp a.cpp.a9394 b.cpp.b956 were created, content irrelevant.

Next I went to ~/Downloads and pressed <Alt><F7> in Total Commander 8.5.1ß3 and made it search for "*.cpp.*" (without the double quotes).
It found: a.cpp b.cpp c.cpp a.cpp.a9394 b.cpp.b956

Finally I went to ~/Downloads in Gnome Commander and launched Edit => File Search and made it search for "*.cpp.*" (without the double quotes).
Gnome Commander only found: a.cpp.a9394 b.cpp.b956

Testing environment:
Linux Mint 13 32-bit with Wine 1.4.1
Total Commander 8.51ß3 32-bit

Cheers,
Karl
MX Linux 21.3 64-bit xfce, Total Commander 11.50 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
Asperamanca
Junior Member
Junior Member
Posts: 22
Joined: 2005-03-28, 12:50 UTC

Post by *Asperamanca »

MVV wrote:You can use *.cpp.?* (i.e. with at least one character after last dot) for now, but it is interesting why *.cpp.* selects a.cpp.
Thanks for that workaround. Much appreciated!
User avatar
white
Power Member
Power Member
Posts: 5815
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

It works as designed. What do you expect to find with *.* ? File names with a dot in it? Or file names with any extension, also empty ones (like doing "dir *.*" on the command prompt)?

To find file names with a dot in it you would use: *.*.*.
Or: *.*.?*

As said, in your case you can use: *.cpp.?*
Or you can use: *.cpp.*.

"filename" and "filename." are considered equivalent. Think of it as there is always an optional imaginary dot at the end of a file name.
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hi, white.

As the behaviour of Gnome Commander suggests the way how T.C. inteprets "*.cpp.*" is not the only way it might be understood.
To express it clearly: It is not what one would expect.

By the way, Krusader handles the search mask [*.cpp.*] in the same way as Gnome Commander and only returns the filenames
+ a.cpp.a9394
+ b.cpp.b956

In order to avoid being told that Linux file-managers might simply behave differently, let me add: Free Commander 2009.02b agrees with Gnome Commander and Krusader.

Knd regards,
Karl
Last edited by karlchen on 2014-03-18, 16:45 UTC, edited 1 time in total.
MX Linux 21.3 64-bit xfce, Total Commander 11.50 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Actually * means empty extension too, and in such case trailing dot is simply removed from filename.

However I don't think that dot should be removed from mask too, every mask character should be in filename. I would expect to get all files with non-empty extensions on *.*, for all files including ones w/o extensions one may use just * (there should be a difference between * and *.*, and it is here).
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC always assumes a dot at the end of a name (because files can have multiple dots now), that's why the above also matches empty extensions.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5815
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

karlchen wrote:In order to avoid being told that Linux file-managers might simply behave differently, let me add: Free Commander 2009.02b agrees with Gnome Commander and Krusader.
Well, Unix does not have the extension model. So *.* is similar as *A* on such systems.
MVV wrote:I would expect to get all files with non-empty extensions on *.*, for all files including ones w/o extensions one may use just * (there should be a difference between * and *.*, and it is here).
That would break compatibility big time. I don't think users will like it when after updating TC a lot of things don't work as before anymore.

BTW. If I use Windows XP Find and search for *.*, it also finds files without extension.
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

As a standart user, I understand the *.cpp.* as the words which should include the word .cpp. completely in it (with/without preceding/following characters). This seems to me more logical.
User avatar
white
Power Member
Power Member
Posts: 5815
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

HBB wrote:As a standart user, I understand the *.cpp.* as the words which should include the word .cpp. completely in it (with/without preceding/following characters). This seems to me more logical.
When I use Windows XP find, it does work like this. When I use dir on the command prompt it does not.
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

When I use Windows XP find, it does work like this. When I use dir on the command prompt it does not.
Why Microsoft changed the search behavior in GUI may be the answer. Note that DOS is older than windows GUI tools.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It's a question of definition, but I prefer to keep it this way - otherwise *.* would only find files with at least one dot in them, as on Linux. But on Windows, everyone expects that *.* finds all files, also those without extension.
Author of Total Commander
https://www.ghisler.com
Post Reply