targzbz2 plugin don't work with tbz

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
damjang
Senior Member
Senior Member
Posts: 215
Joined: 2003-10-09, 15:58 UTC
Contact:

targzbz2 plugin don't work with tbz

Post by *damjang »

I have installed targzbz2 plugin, because I want to open tgz tar.gz / tbz tar.bz2 archives in one step. For tgz work ok, but for tbz it gave me an error. Is there something I can do?
iana
Senior Member
Senior Member
Posts: 345
Joined: 2010-07-27, 22:00 UTC

Post by *iana »

Do you have the bzip2 plugin installed?
If not install it https://plugins.ghisler.com/plugins/bzipplug.zip
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

For users who use Total commander 8.0 beta 32-bit and 64-bit I would like to recommend installing the latest version which brings along the 32-bit and the 64-bit edition of the BZIP2 plugin. Cf. here.

Karl
damjang
Senior Member
Senior Member
Posts: 215
Joined: 2003-10-09, 15:58 UTC
Contact:

Post by *damjang »

iana wrote:Do you have the bzip2 plugin installed?
If not install it https://plugins.ghisler.com/plugins/bzipplug.zip
Yes, I have!
iana
Senior Member
Senior Member
Posts: 345
Joined: 2010-07-27, 22:00 UTC

Post by *iana »

I've got several thoughts, first do you have total 7-zip installed as bz2 handler if it is try disabiling the bz2 support (delete the line bz2=731,%COMMANDER_PATH%\wcx\Total7zip\Total7zip.wcx) check your ini file, second bzip (bz) and bzip2 (bz2) are not the same, bzip was an early adoption of the Burows-Wheeler transformation (I hope I spelled their names right) and bzip2 isn't backward compatible with bzip can you open that archive without using targzbz2 plugin, and third the targzbz2 plugin should (I think so maybe it's the opposite) have higher priority ie be above the bazip2 plugin in your ini file, if everything fails try with an empty ini.
damjang
Senior Member
Senior Member
Posts: 215
Joined: 2003-10-09, 15:58 UTC
Contact:

Post by *damjang »

I try also with an empty ini and add only this lines:

Code: Select all

[PackerPlugins]
tbz=4,%COMMANDER_PATH%\plugins\wcx\targzbz2\targzbz2.wcx
bz2=251,%COMMANDER_PATH%\plugins\wcx\wcx_bz2\bzip2dll.wcx
but the result is the same: "Error in packed file: name.tbz!". I have TC 5.76a, winxp sp2. If I rename the file in *.bz2 I can extract the content. I have done the tbz file with TC, first a tar and then the bz2...
iana
Senior Member
Senior Member
Posts: 345
Joined: 2010-07-27, 22:00 UTC

Post by *iana »

If I rename the file in *.bz2 I can extract the content.
as bz2 is only a compressor not an archiver don't rename the bziped tar's but use the original suffixes *.tar.bz2
if you absolutely need tbz support (I've never come across a tbz filename) add the line
tbz=251,%COMMANDER_PATH%\plugins\wcx\wcx_bz2\bzip2dll.wcx
after
bz2=251,%COMMANDER_PATH%\plugins\wcx\wcx_bz2\bzip2dll.wcx
in wincmd.ini
damjang
Senior Member
Senior Member
Posts: 215
Joined: 2003-10-09, 15:58 UTC
Contact:

Post by *damjang »

But if I do in this way I'm not able to open the tar.bz2 in one shot, so the plugin targzbz2 is not necessary...
iana
Senior Member
Senior Member
Posts: 345
Joined: 2010-07-27, 22:00 UTC

Post by *iana »

Adding these two lines (or something similar depending where your wcx are installed) allows opening of tar.bz2 files in one step

Code: Select all

bz2=4,%COMMANDER_PATH%\wcx\targzbz2\targzbz2.wcx
bz2=251,%COMMANDER_PATH%\wcx\bz2\bzip2dll.wcx
Check to see if targzbz2.wcx hasn't overwritten the bzip2dll.wcx section, I don't think you can use the current version of targzbz2.wcx for tbz files
iana
Senior Member
Senior Member
Posts: 345
Joined: 2010-07-27, 22:00 UTC

Post by *iana »

A quick glance at the targzbz2 source shows that it doesn't use the bzip2dll.wcx but internal Delphi bz2 unpacker plus the tar.bz2 extension is hard coded

Code: Select all

begin
	if AnsiLowerCase(ExtractFileExt(ArchiveData.ArcName)) = '.bz2' then
		if Pos('.tar.bz2', AnsiLowerCase(ArchiveData.ArcName)) > 0 then
			begin
				try
					ReadFrom := ExtractTarFromBZ(ArchiveData.ArcName);
					TempTar := ReadFrom;
				except
					Result := 0;
					ArchiveData.OpenResult := E_UNKNOWN_FORMAT;
					exit;
				end;
			end
you can try and edit the source or contact the author and ask him to add such a feature but using tbz as an extension will always result with an unknown format error.
damjang
Senior Member
Senior Member
Posts: 215
Joined: 2003-10-09, 15:58 UTC
Contact:

Post by *damjang »

iana wrote:A quick glance at the targzbz2 source shows that it doesn't use the bzip2dll.wcx but internal Delphi bz2 unpacker plus the tar.bz2 extension is hard coded
Ok, if I set bz2 to targzbz2 and use tar.bz2 extension work ok. Thank you!

damjang
iana
Senior Member
Senior Member
Posts: 345
Joined: 2010-07-27, 22:00 UTC

Post by *iana »

imo there are 2 good reasons why not to use this plugin and only 1 weak reason for it.
First the reason pro for this plugin:
you don't have to hit enter when you're browsing a gz (bz2) compressed tar archive.
The two reasons not to use:
1: archives are read only ie you can't add or delete files from tar+gz (bz2) archives, while using tc's internal tar + gz + bzip2dll.wcx you can.
2. This plugin is ANSI only so if the archive contains files with unicode names they'll come out garbled TC 7.5+ has full unicode support (so is the bzip2 plugin) not only can your archive contain files with unicode names you can give the tar archive a unicode name and tc will process it while the targzbz2 plugin won't.
User avatar
Flint
Power Member
Power Member
Posts: 3506
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

One more reason for the plugin is navigating without having to wait until the underlying TAR file (which can be huge) is completely unpacked to the TEMP dir. Unfortunately, drawbacks of this plugin made me drop it when I tried it long ago.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
Post Reply