<div>Hi,</div>
<div>&nbsp;</div>
<div>I recently came across this bug and a possible solution for it.</div>
<div>&nbsp;</div>
<div>
<p>When I open a .tar.gz archive&nbsp;with a complex directory structure within it using ark and try to extract the contents I get two different behaviors based on how I perform it.</p>
<p>1. If I do not select any of the files inside the archive and click on extract button on the toolbar to extract, it does not give any problem.</p>
<p>2. However, if I select the top-most directory and click on extract button on the toolbar to extract, it gives an error message but the files are extracted properly.</p>
<p>I&#39;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.</p>
<p>Consider the following directory structure inside the archive (test.tar.gz).</p>
<p>test<br>|<br>|-demo<br>&nbsp;&nbsp;|<br>&nbsp;&nbsp;|-index.html</p>
<p>Now executing the following command,</p>
<p>tar -xzf test.tar.gz test test/demo test/demo/index.html</p>
<p>would generate the following error,</p>
<p>tar: test/demo: Not found in archive<br>tar: test/demo/index.html: Not found in archive<br>tar: Error exit delayed from previous errors</p>
<p>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.
</p>
<p>tar -xzf test.tar.gz test</p>
<p>would be sufficient. However, this is not true for other archive programs like zip.</p>
<p>The problem at hand:</p>
<p>In the source code of ark, the &quot;FileListView&quot; class (inside filelistview.cpp) contains the function &quot;selectedFilenames()&quot; which adds the children of the selected directory also to the list of selected files. This when used by &quot;TarArch::unarchFileInternal()&quot;, causes the problem.
</p>
<p>Solution:</p>
<p>This problem can be solved, if a piece of code is incorporated into &quot;FileListView::selectedFilenames()&quot; 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.
</p>
<p>I hope this understanding would greatly help the developers in fixing the problem soon. I&#39;m very sorry that I&#39;m not able to solve the problem myself as I don&#39;t have the time to do fix it in the code.</p>
<p>The link to the bug report at launchpad is <a href="https://bugs.launchpad.net/ubuntu/+source/kdeutils/+bug/114784">https://bugs.launchpad.net/ubuntu/+source/kdeutils/+bug/114784</a></p>
<p>-- <br>Bye Bye,<br>Chandru.<br><br>e-mail: <a href="mailto:chandru.in@gmail.com">chandru.in@gmail.com</a><br>Home Page: <a href="http://www.freewebs.com/onlinechandru/">http://www.freewebs.com/onlinechandru/</a><br>Blog: 
<a href="http://tuxychandru.blogspot.com/">http://tuxychandru.blogspot.com/</a><br><br>A computer is like air conditioning: it becomes useless when you open windows.&nbsp;&nbsp;--Linus Torvalds on Windows </p></div>