Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Pack from search results: TC passes items multiple times
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Total Commander Forum Index -> TC Fixed bugs Printable version
View previous topic :: View next topic  
Author Message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 4534
Location: Russian Federation

PostPosted: Sun Jul 22, 2012 6:30 am    Post subject: Pack from search results: TC passes items multiple times Reply with quote

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:
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.
_________________
VirtualPanel plugin: Temporary panel for TC (forum)
TOTALCMD.NET: TCFS2, NTLinks, CopyTree, AskParam, ConPaste, Sudo…


Last edited by MVV on Sun Jul 22, 2012 7:20 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
MaxX
Senior Member
Senior Member


Joined: 23 Mar 2012
Posts: 311

PostPosted: Sun Jul 22, 2012 7:00 am    Post subject: Reply with quote

Confirm!

TC 8.01 RC4
Back to top
View user's profile Send private message
white
Power Member
Power Member


Joined: 19 Nov 2003
Posts: 1305
Location: Netherlands

PostPosted: Sun Jul 22, 2012 10:56 am    Post subject: Re: Pack from search results: TC passes items multiple times Reply with quote

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.
_________________
#16626 Personal licence
Back to top
View user's profile Send private message Send e-mail
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 4534
Location: Russian Federation

PostPosted: Sun Jul 22, 2012 11:23 am    Post subject: Reply with quote

TC should know that it enumerates same folder twice regardless of that checkbox. And, BTW, bug may be reproduced regardless of its state.
_________________
VirtualPanel plugin: Temporary panel for TC (forum)
TOTALCMD.NET: TCFS2, NTLinks, CopyTree, AskParam, ConPaste, Sudo…
Back to top
View user's profile Send private message Send e-mail
white
Power Member
Power Member


Joined: 19 Nov 2003
Posts: 1305
Location: Netherlands

PostPosted: Sun Jul 22, 2012 11:52 am    Post subject: Reply with quote

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.
_________________
#16626 Personal licence
Back to top
View user's profile Send private message Send e-mail
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 4534
Location: Russian Federation

PostPosted: Sun Jul 22, 2012 1:05 pm    Post subject: Reply with quote

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.
_________________
VirtualPanel plugin: Temporary panel for TC (forum)
TOTALCMD.NET: TCFS2, NTLinks, CopyTree, AskParam, ConPaste, Sudo…
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 24602
Location: Switzerland

PostPosted: Mon Jul 23, 2012 7:31 am    Post subject: Reply with quote

Indeed TC is just doing what it is instructed.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
white
Power Member
Power Member


Joined: 19 Nov 2003
Posts: 1305
Location: Netherlands

PostPosted: Mon Jul 23, 2012 9:47 am    Post subject: Reply with quote

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

_________________
#16626 Personal licence
Back to top
View user's profile Send private message Send e-mail
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 4534
Location: Russian Federation

PostPosted: Mon Jul 23, 2012 11:16 am    Post subject: Reply with quote

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.
_________________
VirtualPanel plugin: Temporary panel for TC (forum)
TOTALCMD.NET: TCFS2, NTLinks, CopyTree, AskParam, ConPaste, Sudo…
Back to top
View user's profile Send private message Send e-mail
white
Power Member
Power Member


Joined: 19 Nov 2003
Posts: 1305
Location: Netherlands

PostPosted: Mon Jul 23, 2012 12:16 pm    Post subject: Reply with quote

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.
_________________
#16626 Personal licence
Back to top
View user's profile Send private message Send e-mail
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 4534
Location: Russian Federation

PostPosted: Mon Jul 23, 2012 12:37 pm    Post subject: Reply with quote

It would be much better to filter out duplicate files from the list anyway.
_________________
VirtualPanel plugin: Temporary panel for TC (forum)
TOTALCMD.NET: TCFS2, NTLinks, CopyTree, AskParam, ConPaste, Sudo…
Back to top
View user's profile Send private message Send e-mail
white
Power Member
Power Member


Joined: 19 Nov 2003
Posts: 1305
Location: Netherlands

PostPosted: Tue Jul 24, 2012 5:29 am    Post subject: Reply with quote

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.
_________________
#16626 Personal licence
Back to top
View user's profile Send private message Send e-mail
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 4534
Location: Russian Federation

PostPosted: Tue Jul 24, 2012 9:06 am    Post subject: Reply with quote

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

But I see that nothing will be changed here.
_________________
VirtualPanel plugin: Temporary panel for TC (forum)
TOTALCMD.NET: TCFS2, NTLinks, CopyTree, AskParam, ConPaste, Sudo…
Back to top
View user's profile Send private message Send e-mail
Valentino
Power Member
Power Member


Joined: 06 Feb 2003
Posts: 665
Location: Ukraine

PostPosted: Wed Jul 25, 2012 4:55 am    Post subject: Reply with quote

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 Smile )?
Back to top
View user's profile Send private message Send e-mail
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 4534
Location: Russian Federation

PostPosted: Wed Jul 25, 2012 4:59 am    Post subject: Reply with quote

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.
_________________
VirtualPanel plugin: Temporary panel for TC (forum)
TOTALCMD.NET: TCFS2, NTLinks, CopyTree, AskParam, ConPaste, Sudo…
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC Fixed bugs All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group