Pack from search results: TC passes items multiple times

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

Moderators: sheep, Hacker, Stefan2, white

User avatar
MVV
Power Member
Power Member
Posts: 8198
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Pack from search results: TC passes items multiple times

Post by *MVV » 2012-07-22, 12:30 UTC

Suppose you have folder 111 with subfolder 222 with subfolder 333 with files aaa.txt and bbb.txt. Enter folder 111 and search all items in it:

Code: Select all

F:\TEMP\_tc1\111\222\
F:\TEMP\_tc1\111\222\333\
F:\TEMP\_tc1\111\222\333\aaa.txt
F:\TEMP\_tc1\111\222\333\bbb.txt
Now select all items and try to pack them into ZIP archive. TC will try to pack every file three times. And same problem exists for any packer (some packers show a warning, some packers pack files multiple times, some show an error). I think TC should filter out files whose path include already enumerated folders. Yes, it may be done on a plugin side but here some cons:
1. This should be done in every packer plugin instead of single place in TC.
2. TC has small folder list and filelist so it is easy to check if file path starts with some path from the list of selected folders, while plugin get huge enumerated filelist and need to search for duplicate lines in it.
Last edited by MVV on 2012-07-22, 13:20 UTC, edited 1 time in total.

User avatar
MaxX
Power Member
Power Member
Posts: 644
Joined: 2012-03-23, 18:15 UTC
Location: Earth

Post by *MaxX » 2012-07-22, 13:00 UTC

Confirm!

TC 8.01 RC4

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

Re: Pack from search results: TC passes items multiple times

Post by *white » 2012-07-22, 16:56 UTC

MVV wrote:Now select all items and try to pack them into ZIP archive. TC will try to pack every file three times.
If you have Recursively pack subdirectories enabled, then that is exactly what you instructed what should happen.

User avatar
MVV
Power Member
Power Member
Posts: 8198
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2012-07-22, 17:23 UTC

TC should know that it enumerates same folder twice regardless of that checkbox. And, BTW, bug may be reproduced regardless of its state.

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

Post by *white » 2012-07-22, 17:52 UTC

MVV wrote:TC should know that it enumerates same folder twice regardless of that checkbox.
I disagree. TC should do exactly as told.
MVV wrote:And, BTW, bug may be reproduced regardless of its state.
No, if the option is disabled then the files are written twice, which is exactly as designed.

User avatar
MVV
Power Member
Power Member
Posts: 8198
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2012-07-22, 19:05 UTC

It is absolutely pointless to add exactly same files into same folder of same archive more than once. And it is quite easy to detect that user accidentally (can't imagine another reason) have selected same file more than once. The only thing that should be improved is pack filelist generator.

Regardless of any checkbox state TC asks to overwrite both files when you pack them into ZIP and packs same files multiple times when you pack them e.g. using 7Zip.wcx plugin.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36782
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2012-07-23, 13:31 UTC

Indeed TC is just doing what it is instructed.
Author of Total Commander
http://www.ghisler.com

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

Post by *white » 2012-07-23, 15:47 UTC

2MVV
Bare in mind that:
  • Recursion into subdirectories is done by the packer plugin.
  • Packing a folder, by design is interpreted as packing foldername\*.*

User avatar
MVV
Power Member
Power Member
Posts: 8198
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2012-07-23, 17:16 UTC

Recursion is done by TC, not by packer plugin. When you select directory in a search results, TC enumerates its contents and passes to a plugin, TC doesn't pass just folder path.

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

Post by *white » 2012-07-23, 18:16 UTC

MVV wrote:Recursion is done by TC, not by packer plugin. When you select directory in a search results, TC enumerates its contents and passes to a plugin, TC doesn't pass just folder path.
Yes, you are right. I mixed up packer plugins with external packers. I was thinking of external packers. When using external packers, recursion into subdirectories is done by the external packers. And packing a folder is interpreted as packing foldername\*.*

TC's internal packers and the internal packer that utilizes the packer plugins, emulate the behavior of the external packers.

User avatar
MVV
Power Member
Power Member
Posts: 8198
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2012-07-23, 18:37 UTC

It would be much better to filter out duplicate files from the list anyway.

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

Post by *white » 2012-07-24, 11:29 UTC

MVV wrote:It would be much better to filter out duplicate files from the list anyway.
While this may be convenient for people who don't realize what they are doing, it would be confusing for people who do and expect the overwrite dialog to appear. Furthermore this would create an inconsistency between internal packers and external packers.

User avatar
MVV
Power Member
Power Member
Posts: 8198
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2012-07-24, 15:06 UTC

I don't believe someone expecting overwrite confirmation when TC tries to overwrite some file with exactly same one. :D

But I see that nothing will be changed here.

User avatar
Valentino
Power Member
Power Member
Posts: 693
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino » 2012-07-25, 10:55 UTC

I agree with MVV that TC could optimize the list by removing files that will be packed anyway because their parent folders are in the list (to avoid silly questions about file overwriting itself or to avoid wasting time re-packing these files multiple times) but... mentioned example does not look real to me. If user wants to pack everything in F:\TEMP\_tc1\111\222 he will go to F:\TEMP\_tc1\111 and directs TC to pack 222, or he will go to F:\TEMP\_tc1\111\222, selects everything and directs TC to pack it.

Can you imagine real scenario for this to happen to convince Christian to work on it (although this optimization is so easy that I would just make it instead of talking about it :) )?

User avatar
MVV
Power Member
Power Member
Posts: 8198
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2012-07-25, 10:59 UTC

It happened with some user (here in Russian), he used search to find something and then selected all and tried to pack. List contained files and folders so he got described problem.

Post Reply