Case sensitive search

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Thany
Senior Member
Senior Member
Posts: 292
Joined: 2003-09-30, 09:20 UTC
Location: Netherlands

Case sensitive search

Post by *Thany »

Can we have an option to search for filenames with case-sensitivity?

Sometimes, even on case-insensitive filesystems, I want to search for those files with all-uppercase extensions and fix them. For neatness and OCD.

The current workaround is to use a plugin-but-not-really-because-its-built-in search with tc->fullname, and use "cont.(case)". But really, a checkbox on the main page would be much easier.

Before you start "hey, you're on Windows, which is NTFS or FAT32 or exFAT, which is case-insensitive, and TC just follows that", it doesn't. I'm on my NAS, which is Ext4, which is case-sensitive, and TC ignores it (well it probably can't know what FS is behind a samba share, and/or whether that FS is case-sensitive).
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

case-sensitivity file name search upper case lower case sear

Post by *Stefan2 »

Hi Thany

you could also just utilize RegEx search

Find: (?-i)XLS|TXT|DOC
[x]RegEx


Or for any extension:
Find: (?-i)\.[A-Z][A-Z][A-Z]$
Find: (?-i)\.[A-Z]+$
[x]RegEx



To read more, press F1-key in Search dialog
- click at 'regular expressions' of "RegEx Search in file names using regular expressions."
- scroll down to "Modifiers are used for changing behaviour of regular expressions."

(?i) Ignore Upper-/lowercase. In Total Commander, this is the default for file names.
(?-i) Case-sensitive matching.




HTH? :D


 
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Case sensitive search

Post by *nsp »

Thany wrote:...
Before you start "hey, you're on Windows, which is NTFS or FAT32 or exFAT, which is case-insensitive, and TC just follows that", it doesn't. I'm on my NAS, which is Ext4, which is case-sensitive, and TC ignores it (well it probably can't know what FS is behind a samba share, and/or whether that FS is case-sensitive).
In fact it is not really a TC issue but more a samba issue, on my share i set in samba smb.conf :
case sensitive=no
short preserve case = no

Windows is agnostic to case even if it is able to show / create using different case is not able to detect/prevent name collision this can lead to funny behaviors...
Thany
Senior Member
Senior Member
Posts: 292
Joined: 2003-09-30, 09:20 UTC
Location: Netherlands

Re: case-sensitivity file name search upper case lower case

Post by *Thany »

Stefan2 wrote: you could also just utilize RegEx search

Find: (?-i)XLS|TXT|DOC
[x]RegEx
Well, I suppose it's a viable workaround. Regexes are too clunky to do a quick search for a pattern so easy to type like "w*.xls;words.*"
nsf wrote: In fact it is not really a TC issue but more a samba issue
I'm not saying it's an issue, I'm saying it's a missing feature. It can't be too hard to search case-sensitively. Before comparing: instead of upper- or lowercasing everything, just, you know, don't. And it'll be case-sensitive. It's the simplest comparison form I can think of.

So what I'm saying is, don't point fingers at other systems, and then hope that TC will magically pick it up. And on top of that, I want to case-sensitively search on a FS that isn't. Is that too much asked?

If I can draw any kind of conclusion from this: clearly, regex search can be case-sensitive, so why can't pattern search do the same?
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: case-sensitivity file name search upper case lower case

Post by *Stefan2 »

Thany wrote:Is that too much asked?
No. Go ahead.


I guess it's just not of that much use for on WindowsTM systems
so the author wants to bother the majority with not need features
in direct front of them, that's all.

And we have seen two usable workarounds in this thread already.






 
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: case-sensitivity file name search upper case lower case

Post by *nsp »

Thany wrote:....

If I can draw any kind of conclusion from this: clearly, regex search can be case-sensitive, so why can't pattern search do the same?
Usually pattern search is handled by Windows system FindFirstFileEx and the O.S. as said do not care of case...
You can use everything with case: modifier from TC search but the search syntax nead some learning curve..

Code: Select all

ed: case:<*.ZIP|*.RAR>
search with everything taking path into acount for case sensitve .ZIP or .RAR.
Thany
Senior Member
Senior Member
Posts: 292
Joined: 2003-09-30, 09:20 UTC
Location: Netherlands

Post by *Thany »

@Stefan2
The thing is, case-insensitive searching takes more work. You need to upper/lowercase both strings when comparing. Just *not* doing that will make a comparison case-sensitive. It absolutely, really, honestly, genuinely is that simple.

@nsp
FindFirstFileEx is apparently not good enough. But for other types of searches (regex) this can't be used, so why use it in one situation, and use a different function in a different situation. I say, never use something that works only half the time. Use the same function for searching by regex, because it already knows about case. Only adapt it to also know how to compare patterns.

And honestly, file patterns are incredibly simplistic. Shouldn't take much work to compare them "manually" in code.
Post Reply