-Improper handling of invalid paths in search dialog

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

-Improper handling of invalid paths in search dialog

Post by *MarcinW »

Steps to reproduce:
1) Create directory C:\TEST1 and place some file there, let's say file.txt.
2) Do NOT create directory C:\TEST2.
3) Press Alt+F7.
4a) Paste in "Search in" field: C:\TEST1;C:\TEST2 and press "Start search" - file.txt will be found (TC ignores invalid C:\TEST2 path).
4b) Paste in "Search in" field: C:\TEST2;C:\TEST1 and press "Start search" - file.txt will NOT be found with message "Search path not found!" (TC does NOT ignore invalid C:\TEST2 path).

Maybe TC should display error message only when all entered paths are invalid.

Regards
User avatar
Gral
Power Member
Power Member
Posts: 1460
Joined: 2005-01-26, 15:12 UTC

Post by *Gral »

It's even more interesing if you search for FILE.TXT in:
C:\TEST1;C:\TEST2;C:\TEST3
while
C:\TEST1 is empty
C:\TEST2 doesn't exists
C:\TEST3 contains FILE.TXT
It seems only first path must be valid.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, TC only checks the first path when starting the search. This is by design. The check is just a convenience for the not so experienced user to warn why there is no result. Currently there are no plans to check all the paths.
Author of Total Commander
https://www.ghisler.com
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

This could be very useful if TC could continue even when the first path is invalid. Currently I have a search scheme saved (in Load/Save tab) and, after deleting one of directories (the first only), I can't search in others. After deleting a directory other than the first, I can work with saved search scheme without any problem.

I know, that in this case the search scheme becomes "invalid" and should be corrected. But when the directory has been deleted for a moment only (and will be restored from a backup soon), it would be useful to still be able to perform the search.

In all cases TC must parse the "Search in" field, so all the code is already inside TC. Adding one variable (let's say FoundAnyValidDir : Boolean), initially set to False, but set to True whenever TC finds a valid directory, would solve this problem completely in 1 minute. Please consider adding this functionality.

Regards
User avatar
Gral
Power Member
Power Member
Posts: 1460
Joined: 2005-01-26, 15:12 UTC

Post by *Gral »

Although i understand how it's works, i don't understand why works this way.
I totally agree with MarcinW. TC should try to search through all valid paths.
ghisler(Author) wrote: ...
The check is just a convenience for the not so experienced user to warn why there is no result.
...
This is not true - the check itself is the only reason why nothing is found!
There is not result because TC didn't even try to search all paths!

Imagine: less or more experienced user enter to directory C:\TEST3 and start search by typing -
Search for: FILE.TXT (visible in directory TEST3)
Search in: C:\TEST1;C:\TEST2C:\TEST3 (while TEST1 doesn't exist)
Result: Nothing is found!
Try to explain this - why TC cannot find definitely existing file?

 
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

I agree that the current behaviour is extremely unexpected and not logic.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

This is fixed now - thanks!

Can be moved to "Fixed Bugs".
Post Reply