-Improper handling of invalid paths in search dialog

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

Moderators: Hacker, Stefan2, white, sheep

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 » 2014-05-12, 01:02 UTC

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: 624
Joined: 2005-01-26, 15:12 UTC

Post by *Gral » 2014-05-12, 05:14 UTC

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: 36354
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2014-05-12, 10:08 UTC

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
http://www.ghisler.com

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

Post by *MarcinW » 2014-05-12, 11:51 UTC

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: 624
Joined: 2005-01-26, 15:12 UTC

Post by *Gral » 2014-05-13, 04:17 UTC

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: 8004
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Post by *petermad » 2014-05-13, 20:59 UTC

I agree that the current behaviour is extremely unexpected and not logic.
License #524
Danish Total Commander Translator
TC 9.21a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit and TC 2.91b4 on Android 6.0
Get Extended Total Commander Menus | PHSM-Calendar

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

Post by *MarcinW » 2018-06-14, 10:55 UTC

This is fixed now - thanks!

Can be moved to "Fixed Bugs".

Post Reply