Different behavior for filenames with and without dots

Support for Android version of Total Commander

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Usher
Power Member
Power Member
Posts: 1726
Joined: 2011-03-11, 10:11 UTC

Different behavior for filenames with and without dots

Post by *Usher »

Create two files: name_without_dots.ext and name.with.dots.ext
Tap name_without_dots.ext and you will see context menu from TC4A (Open with, Open as etc.).

Ignore it and tap name.with.dots.ext now. TC4A passes the action to Android system and you will see menu "Open in application" from system "Files" application.

Tested on Redmi Note 8T, Android 11, MIUI 12, TC4A 3.60b2d for "Files" apk with and without updates.

There is another topic which mentions similar behavior, but with no solution given:
https://www.ghisler.ch/board/viewtopic.php?t=76783
Last edited by Usher on 2024-06-30, 19:09 UTC, edited 1 time in total.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Different bahavior for filenames with and without dots

Post by *ghisler(Author) »

There are various ways to define file associations in Android:
1. Via MIME type. For example, Text files have type "text/plain". An app can tell Android that it can handle "text/plain", and when you tap on a txt file, Android will include the app in the list of available targets.
2. Via wildcards. This is done via "android:pathPattern" parameter of the intent filter. Example:
android:pathPattern="/.*\\.txt"
Unfortunately this only matches a name with a single dot in it.

You can find a discussion on Stack Overflow.

So in your case, an app has only defined android:pathPattern="/.*\\.ext" for the affected extension.
Author of Total Commander
https://www.ghisler.com
User avatar
Usher
Power Member
Power Member
Posts: 1726
Joined: 2011-03-11, 10:11 UTC

Re: Different behavior for filenames with and without dots

Post by *Usher »

Thanks for your explanation. I understand that there may be different actions defined for different associations, but there is no association defined for .ext at all. You can observe the same difference in behavior for any unknown file type. It is TC that makes different actions.
Andrzej P. Wozniak
Polish subforum moderator
Post Reply