Repacking archive and the Move opt.

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
gskoczylas
Junior Member
Junior Member
Posts: 9
Joined: 2008-06-19, 21:51 UTC

Repacking archive and the Move opt.

Post by *gskoczylas »

I have a fairly large archive in ZIP format. I wanted to convert it into 7z format. Of course, I have the 7z plug-in installed (Total7zip.wcx). In a panel I enter the ZIP archive and select all files and folders. Then I press the [Alt+F5] keys to launch the Pack files dialogue. By default, I have Also pack path names and Recursively pack subdirectories checked. Additionally, I select the option Move to archive. I expect that all files will be stored in the new archive and, finally, deleted from the existing archive. This is not happening. The files are in the new archive, but they are in the old one too.

In this case, that is not a problem, because if I want to repackage the entire archive, I can finally simply delete the ZIP file. However, I can imagine a situation where someone has a large archive with many files and folders and would like to transfer only selected files or folderes to the new archive. Then that can be a problem.

Ideally, this option should also work in such scenario. If this is not possible, it should probably be disabled for such operations.
User avatar
Dalai
Power Member
Power Member
Posts: 9395
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Repacking archive and the Move opt.

Post by *Dalai »

Move to archive doesn't move files from other archives, only from a simple directory structure. Although I'm not sure I think this is intentional, not a bug.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Repacking archive and the Move opt.

Post by *gdpr deleted 6 »

If it is intentional (1), the checkbox ought to be disabled (or whatever other clear indication that moving files in this context is not possible)

-------
(1) It could be intentional; after all, deleting files from some archive types, especially solid archives, can be a slow/demanding/costly process. And who knows, depdending on whatever unusual "packer" plug-in in use, deleting/moving might not even be possible to begin with...
User avatar
Dalai
Power Member
Power Member
Posts: 9395
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Repacking archive and the Move opt.

Post by *Dalai »

elgonzo wrote: 2020-09-20, 12:41 UTCIf it is intentional (1), the checkbox ought to be disabled (or whatever other clear indication that moving files in this context is not possible)
I agree.
And who knows, depdending on whatever unusual "packer" plug-in in use, deleting/moving might not even be possible to begin with...
Well, even some of the real packer plugins may not be able to create archives or modify existing ones: deb, msi-plus, iso, and some of the formats of Total7zip (e.g. squashfs, rpm, nsis).

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Repacking archive and the Move opt.

Post by *Usher »

@gskoczylas
Some plugins or archive formats don't support some features, for example "moving inside" (packing and deleting the source file) or "moving outside" (unpacking and deleting from archive). Disabling unavailable features is a matter of plugin configuration, not a bug in TC itself. What plugin do you use for zip format?

Note that 7z is a solid archive and 7zip always creates a new archive and repacks all files if you use any command change archive (add, update, delete and even rename). Adding files to 7z in many steps is just a waste of time.
Andrzej P. Wozniak
Polish subforum moderator
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Repacking archive and the Move opt.

Post by *gdpr deleted 6 »

Usher wrote: 2020-09-20, 14:59 UTC Disabling unavailable features is a matter of plugin configuration, not a bug in TC itself. What plugin do you use for zip format?
1) Disabling the checkbox is a matter of TC, as the reported observation also applies to TC's built-in (un)packer functionality.
2) Afaik, a packer plug-in cannot tell TC whether "move" is supported or not. If i am mistaken, could you please let me know which API or configuration parameter a packer-plugin would use to tell TC its capabilities?
User avatar
petermad
Power Member
Power Member
Posts: 14810
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Repacking archive and the Move opt.

Post by *petermad »

2elgonzo
could you please let me know which API or configuration parameter a packer-plugin would use to tell TC its capabilities
It is the number after the = in the [PackerPlugins] section, that tells TC the capabilities of the plugin - for example:

7z=735,%COMMANDER_PATH%\PLUGINS\wcx\Total7zip\Total7zip.wcx
flv=964,%COMMANDER_PATH%\PLUGINS\wcx\Total7zip\Total7zip.wcx
lst=21,%COMMANDER_PATH%\PLUGINS\wcx\diskdir\diskdir.wcx
Help wrote: The number is the sum of all capabilities:
1: Can create new archives
2: Can modify existing archives
4: Can handle multiple files in one archive
8: Can delete files from archive
16: Supports the options dialog
32: Supports packing in memory
64: Detects archive type by content
128: Allows searching for text in archives
256: Don't open with Enter, only with Ctrl+PgDn
512: Supports encryption
Notice that the Help file also says:
Do NOT add this number yourself, Total Commander will add it on the first load of the DLL.
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Repacking archive and the Move opt.

Post by *gdpr deleted 6 »

2petermad
thanks!

I played around a little bit, creating packer plug-in entries without "Can modify existing archives" and "Can delete files from archive" bits/flags set (specifically, i used the value 724).

But, like with the built-in packer functionality, it does not have an effect on the "Move to archive" checkbox (with the respective packer plug-in serving as the file source). Move checkbox can still be enabled/checked, yet the files are not removed from the source archive, regardless whether the built-in packer functionality or the packer plug-in used for the file source are actually able to delete files from an archive... :(
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Repacking archive and the Move opt.

Post by *ghisler(Author) »

Moving files between archives is indeed not supported, because it would involve 2 separate pack operations.
Author of Total Commander
https://www.ghisler.com
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Repacking archive and the Move opt.

Post by *gdpr deleted 6 »

ghisler(Author) wrote: 2020-09-22, 09:17 UTC Moving files between archives is indeed not supported, because it would involve 2 separate pack operations.
Then, ideally, the "Move to archive" checkbox should be disabled if the file source is an archive.
User avatar
petermad
Power Member
Power Member
Posts: 14810
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Repacking archive and the Move opt.

Post by *petermad »

Then, ideally, the "Move to archive" checkbox should be disabled if the file source is an archive.
I agree.
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
gskoczylas
Junior Member
Junior Member
Posts: 9
Joined: 2008-06-19, 21:51 UTC

Re: Repacking archive and the Move opt.

Post by *gskoczylas »

ghisler(Author) wrote: 2020-09-22, 09:17 UTC Moving files between archives is indeed not supported, because it would involve 2 separate pack operations.
It has always seemed to me that computers are there to make people's lives easier. :wink:

Seriously, if the TC does not do this, I have to do it manually. The result is the same, but I have to perform more actions, spending more time, and there is a greater risk that I will make a mistake.
gskoczylas
Junior Member
Junior Member
Posts: 9
Joined: 2008-06-19, 21:51 UTC

Re: Repacking archive and the Move opt.

Post by *gskoczylas »

Usher wrote: 2020-09-20, 14:59 UTC Note that 7z is a solid archive and 7zip always creates a new archive and repacks all files if you use any command change archive (add, update, delete and even rename). Adding files to 7z in many steps is just a waste of time.
It seems to me that to copy files from an archive in ZIP format to an archive in 7z solid format TC first extracts all (or selected) files to disk and then compress them in the 7z archive. I know that sometimes modifying an archive requires rewriting. I use this function consciously, knowing the consequences.

From my point of view, I see no reason why the TC could not take one more step at the end of such process, which is to delete selected files from the source archive, even if this would result in rewriting the archive. The TC can already do any of these operations, so it seems to me that the implementation of this additional step should not require coding a complex algorithm. Of course, I do not know the source code of the TC, so I may be wrong about that.
Post Reply