Comment 3 for bug 114784

Revision history for this message
Chandru (chandru-in-deactivatedaccount) wrote : Re: Found the fix

I've found where the problem lies. The problem is caused due to the fact that the tar program reports error when both a directory and its files/subdirs are provided in the list of files to be extracted.

Consider the following directory structure inside the archive (test.tar.gz).

test
|
|-demo
  |
  |-index.html

Now executing the following command,

tar -xzf test.tar.gz test test/demo test/demo/index.html

would generate the following error,

tar: test/demo: Not found in archive
tar: test/demo/index.html: Not found in archive
tar: Error exit delayed from previous errors

This is exactly the problem generated by ark. There is no necessity to include the children of the directory selected to be included in the list of files to be extracted, as the contents of the directories specified get extracted by default.

tar -xzf test.tar.gz test

would be sufficient. However, this is not true for other archive programs like zip.

The problem at hand:

In the source code of ark, the "FileListView" class (inside filelistview.cpp) contains the function "selectedFilenames()" which adds the children of the selected directory also to the list of selected files. This when used by "TarArch::unarchFileInternal()", causes the problem.

Solution:

This problem can be solved, if a piece of code is incorporated into "FileListView::selectedFilenames()" to check the mime-type of the currently opened archive and if it is a tar type, the children of the selected directories should not be included in the list of selected files.

I hope this understanding would greatly help the developers in fixing the problem soon. I'm very sorry that I'm not able to solve the problem myself as I don't have the time to do fix it in the code. I've dared to change the status of the bug to "confirmed".