+-Search in @list.txt: directory level wrong

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

Moderators: white, Hacker, petermad, Stefan2

User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

+-Search in @list.txt: directory level wrong

Post by *white »

* Start Search
* Search for: <empty>
* Search in: c:\temp\
* Search in subdirectories: Start with "current dir only", then 1 level deep, then 2 level deep. Remember the results

Now put "c:\temp\" in a new file c:\list.txt
Use this file in the Search in field.
* Search in: @c:\list.txt
* Search in subdirectories: Start with "current dir only", then 1 level deep, then 2 level deep. Compare with previous results.

When the Search in folder is put in a file, the search is performed 1 level less deep. When searching with option "current dir only", the search results always mentions "1 files and 1 directories found" and only the directory itself is listed.

Tested TC8.50rc1 32bit and TC8.01 32 bit. Same results.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This is a question of definition. Currently when you choose "only current directory", it finds just
C:\temp
itself. This is useful when you just want to show the files/folders inside the search list itself.

When you choose "1 level", it finds all files/folders directly inside C:\temp.

Therefore I think that the current solution is better.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:This is a question of definition. Currently when you choose "only current directory", it finds just
C:\temp
itself. This is useful when you just want to show the files/folders inside the search list itself.
OK. But the results say "1 files and 1 directories found", but only 1 directory is found and listed and no file!
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Seems there are more things wrong, see the following tests.

1. create folder c:\temp\z2

2. In file c:\temp\list.txt:
c:\temp\<^z2$

3. Search in @c:\temp\list.txt

4. Search in current dir only. Result:
c:\temp

5. Search 1 level deep. Result:
c:\temp\z2


--------

1. In file c:\temp\list.txt:
c:\

2. Go to c:\ and start Find files

3. Search in @c:\temp\list.txt

4. Search in current dir only. Result:
No files found

--------

1. In file c:\temp\list.txt:
c:\

2. Go to other folder than c:\ and start Find files

3. Search in @c:\temp\list.txt

4. Search in current dir only. Result:
c:
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

These options are not supported. It's not determined what will happen when you use them.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

white wrote:But the results say "1 files and 1 directories found", but only 1 directory is found and listed and no file!
Is this going to be fixed?

ghisler(Author) wrote:These options are not supported. It's not determined what will happen when you use them.
Well having the following file containing the folders to be searched looks normal to me.

Code: Select all

c:\
d:\
e:\folder\
People can select search in current dir only. At least it should be handled consistently. If "search in current dir only" in combination with using a search list file means load list file. Why not make this work for root folders as well? It seems to almost work. Why not fix it?

ghisler(Author) wrote:This is a question of definition. Currently when you choose "only current directory", it finds just
C:\temp
itself. This is useful when you just want to show the files/folders inside the search list itself.

When you choose "1 level", it finds all files/folders directly inside C:\temp.

Therefore I think that the current solution is better.
After testing I really find this undocumented feature very user unfriendly. In case of a list file the option "search current dir only" means something entirely different. It is not a first level search which results are extended when a higher level is chosen. Level 1 becomes base level and "current dir only" means disable search ("search for" field is ignored) and load list from file (check for existence of file or folder only).

I hope you will consider the following suggestion. In my opinion this will make it much more clear for the user and much easier to document.

I suggest to use a separate option to load the list file and let "current dir only" be the base search level like when doing a normal search. The new option could be yet another checkbox, or an extra option named "no search (load list)" in the search in subdirectories dropdown list, or perhaps some signal in the Search in field (for example using double @ to load list: @@c:\path\filelist.txt).
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

But the results say "1 files and 1 directories found", but only 1 directory is found and listed and no file!
Is this going to be fixed?
Yes, of course.

Searching c:\ in the list will also be fixed - TC was using FindFirstFile to determine whether the path exists, but this doesn't work with drives. I will use GetDriveType.

However, c:\temp\<^z2$ will not be handled differently when searching in the current folder only. That's what I meant with "not supported" - searching the current path only AND specifying a filter doesn't work together, it's contradicting.
After testing I really find this undocumented feature very user unfriendly. In case of a list file the option "search current dir only" means something entirely different.
No it doesn't! When you put c:\path in the "Search in" field, then TC searches in this folder only when you use that option.

When you put @c:\path\list inside, then this is the container, so TC will search this container only - not go inside the items of this container.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:
After testing I really find this undocumented feature very user unfriendly. In case of a list file the option "search current dir only" means something entirely different.
No it doesn't! When you put c:\path in the "Search in" field, then TC searches in this folder only when you use that option.

When you put @c:\path\list inside, then this is the container, so TC will search this container only - not go inside the items of this container.
To me, search "current dir only" sounds completely different than search in a file. Furthermore following your logic, a level 1 search should search the container AND 1 level deep in found folders. This is not the case. The folders in the file are the base of the search. It is also presented this way in the help text.

The question is is the current behavior understandable and intuitive for the user. I assume you added this functionality for the user to be used. Don't you agree that my suggestion makes the functionality much more clear and therefor more accessible?

Thanks for fixing the other issues.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Well, many users may have saved searches with N levels depth, and it would be a bad idea to change that now after so many years.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The following was changed in RC2:
- c:\ will be found now
- duplicate reporting of folders as files+folders fixed
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

HISTORY.TXT wrote:28.01.14 Fixed: Search function, use list file @c:\path\file.txt -> reported also found files (e.g. 1 file and 1 folder instead of just 1 folder) when searching only current dir (32/64)
Tested OK using TC8.50rc2 32bit and 64bit.
HISTORY.TXT wrote:28.01.14 Fixed: Search function, use list file @c:\path\file.txt -> drive root like c:\ not found when searching only current dir (32/64)
The root folders now are found and presented as files instead of folders.
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:Well, many users may have saved searches with N levels depth, and it would be a bad idea to change that now after so many years.
It only concerns searching using a list file, which was added less than 2 years ago. And you don't have to change the way it is stored in the ini file. I'm not suggesting to change functionality, only user interface. A saved search with list file and search level 0 could be presented in Total Commander as a list file and option "no search (load list)". A saved search with list file and search level 1 could be presented in Total Commander as a list file and search in current dir only. Etc.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The root folders now are found and presented as files instead of folders.
NOT confirmed, they appear as folders here...
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:
The root folders now are found and presented as files instead of folders.
NOT confirmed, they appear as folders here...
Search_results_displayed_wrongly.png
Search_results_in_file_panel_displayed_wrongly.png

Using TC8.50rc2 32bit and Windows XP.

...

Got good results now too.
Search_results_displayed_correctly.png
Search_results_in_file_panel_displayed_correctly.png


Seems to work correct when using Alt+I followed by Alt+S.
Pressing Alt+S one or more times -> wrong results.
Pressing Alt+I, Alt+S -> correct results again.
Last edited by white on 2014-04-30, 21:18 UTC, edited 1 time in total.
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Root folders are now seen as folders always. Tested using TC8.50rc3 32bit.

Nice, you can now copy multiple drives to one in one go.
Post Reply