Bug 104404

Summary: Support for file type ARJ
Product: [Applications] ark Reporter: Thomas Winischhofer <thomas>
Component: pluginsAssignee: Ragnar Thomsen <rthomsen6>
Status: RESOLVED FIXED    
Severity: wishlist CC: elvis.angelaccio, nate, psychonaut, rakuco
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In: 22.12
Bug Depends on:    
Bug Blocks: 192630    
Attachments: Test ARJ archive

Description Thomas Winischhofer 2005-04-23 00:58:37 UTC
Version:            (using KDE KDE 3.4.0)
Installed from:    Unspecified Linux

Well, just please add ARJ support. There are some unarj tools as well as an arj application available from various sources.
Comment 1 Raphael Kubo da Costa 2010-12-08 02:14:32 UTC
Changing the default assignee for currently open Ark bug reports to me.
Comment 2 Elvis Angelaccio 2016-05-07 10:12:34 UTC
Created attachment 98827 [details]
Test ARJ archive
Comment 3 2wxsy58236r3 2020-04-03 04:43:10 UTC
Since p7zip can extract ARJ archives, should we add application/x-arj to the supported MIME types of the cli7zplugin?
Comment 4 Elvis Angelaccio 2020-04-05 15:39:33 UTC
The problem is that the cli7zplugin is marked as "readwrite", so it should also be able to create ARJ archives. Can p7zip do that?
Comment 5 2wxsy58236r3 2020-04-06 02:15:00 UTC
Oh, it seems p7zip can read but cannot write ARJ archives.

As an alternative, how about using the cliunarchiverplugin? Unarchiver can open many formats, including ARJ and LHA (Bug 321951).
Comment 6 Elvis Angelaccio 2020-04-12 09:49:25 UTC
(In reply to 2wxsy58236r3 from comment #5)
> Oh, it seems p7zip can read but cannot write ARJ archives.
> 
> As an alternative, how about using the cliunarchiverplugin? Unarchiver can
> open many formats, including ARJ and LHA (Bug 321951).

That should be doable, yes.
Comment 7 2wxsy58236r3 2020-04-12 11:24:34 UTC
(In reply to Elvis Angelaccio from comment #6)

The Unarchiver plugin claims that it is capable of opening the following file types:

application/x-msi
application/x-stuffit
application/x-arj (This bug)
application/x-arc
application/x-pak
application/x-ace
application/x-zoo
application/x-lha (Bug 321951, a.k.a. LZH)
application/x-amiga-disk-format
application/x-alz
application/x-nintendo-ds-rom

Reference:
https://code.google.com/archive/p/theunarchiver/wikis/SupportedFormats.wiki

(A more readable version: https://github.com/mietek/theunarchiver/wiki/SupportedFormats)
Comment 8 Bug Janitor Service 2021-01-14 06:25:36 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/ark/-/merge_requests/23
Comment 10 Higa 2021-03-14 02:51:14 UTC
Unarchiver has a bug [1] which prevents correct decompression of arj archives which contain filenames with slashes, so I have submitted a request to revert my commit earlier. Sorry for that.

[1] https://github.com/MacPaw/XADMaster/issues/69

See also: https://phabricator.kde.org/T2443#78198
Comment 11 Tristan Miller 2021-03-14 21:28:10 UTC
(In reply to Higa from comment #10)
> Unarchiver has a bug [1] which prevents correct decompression of arj
> archives which contain filenames with slashes, so I have submitted a request
> to revert my commit earlier.

So why reopen this bug report instead of opening a new one for that particular edge case?  Surely the commit you submitted will add functionality that works with 99.9+% of ARJ archives, and so it would be better to keep it in place pending a fix for the bug.
Comment 12 Nate Graham 2021-03-14 22:36:46 UTC
Yep, that's what should happen.
Comment 13 Higa 2021-03-15 01:23:51 UTC
> So why reopen this bug report instead of opening a new one for that particular edge case?  Surely the commit you submitted will add functionality that works with 99.9+% of ARJ archives
If an ARJ archive has folders, it is likely affected by the unarchiver bug.
The autotest file [1] is also affected - the contents are listed properly, but if one attempts to extract it by dragging the contents to Dolphin, an error will be thrown.
If it is extracted in Dolphin by right-click -> Extract archive, the folder hierarchy is lost and filenames become something like data_A_B_C_test2.txt.

Is there a way to workaround this bug in Ark? If so, I can open a new bug report in KDE Bugtracker.

From T2443, Ark developers are waiting for upstream fix, and additionally I am not sure how many ARJ archives are affected by the bug, so I thought I should revert my commit.

I apologize for the troubles I have caused. I should have done more testing.

For the time being, affected ARJ archives can be extracted by p7zip [2] in command line. [3]

[1] https://invent.kde.org/utilities/ark/-/blob/master/autotests/plugins/cliunarchiverplugin/data/multiple_toplevel_entries.arj
[2] Or 7zz (the binary is called "7zz" instead of "7z"), provided by the upstream 7-Zip 21.01 alpha version for Linux, released by Igor Pavlov (source code is not yet available though)
[3] Although Ark has a p7zip plugin, if I remember correctly, it is currently a read-write plugin, so read-only formats like ARJ cannot be added to cli7zplugin for the time being.
Comment 14 Tristan Miller 2021-03-15 08:53:39 UTC
(In reply to Higa from comment #13)
> If an ARJ archive has folders, it is likely affected by the unarchiver bug.

Then I think you ought to have said that the bug affects paths containing a slash, not filenames containing a slash.  The former is exceedingly common and the latter exceedingly uncommon.
Comment 15 Elvis Angelaccio 2022-10-06 00:19:15 UTC
https://invent.kde.org/utilities/ark/-/commit/01d0a2dd13fd888dd75caa5844ecb69f40e6ae00

Ark master (future 22.12 KDE Gear release) now has a proper backend to handle the ARJ format. Thanks to Ilya Pominov for the contribution.