Bug 351593

Summary: Ark extracts into subdirectory regardless of "Extract into subdirectory" checkbox
Product: [Applications] ark Reporter: Steven Roose <stevenroose>
Component: generalAssignee: Elvis Angelaccio <elvis.angelaccio>
Status: RESOLVED WORKSFORME    
Severity: normal CC: lodp, rthomsen6, stevenroose
Priority: NOR Keywords: triaged
Version First Reported In: 2.19   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: attachment-28056-0.html

Description Steven Roose 2015-08-22 02:15:49 UTC
The extraction menu has a checkbox for whether or not to extract the files directly in the selected directory, or to first create a subdirectory inside that one and extract everything into that directory.
However, the files are always extracted in a subdirectory, regardless of the checkbox.

Reproducible: Always

Steps to Reproduce:
1. Open a zip archive with a directory structure in it, f.e. "archive-name.zip"
2. Select several files from it, f.e. the file "archive-name/some-folder/the.file"
3. Click "Extract"
4. Select a folder, f.e. "/foo"
5. Keep "Extract into subdirectory" unchecked.
6. Extract

Actual Results:  
File is extracted to "/foo/archive-name/some-folder/the.file"

Expected Results:  
File should be extracted to "/foo/some-folder/the.file"
Comment 1 Ragnar Thomsen 2015-08-23 11:31:24 UTC
I think maybe you're confusing the "Extraction into subfolder" and "Preserve paths when extracting" options.

The "Extraction into subfolder" option is used to create a folder and extract the archive into it. The "Preserve paths when extracting" is used to extract the files with their paths, i.e. creating the folder structure inside the archive when extracting. So if you uncheck "Preserve paths when extracting" you should get the desired functionality.
Comment 2 Ragnar Thomsen 2015-08-31 10:59:00 UTC
Can you confirm my previous comment?
Comment 3 Steven Roose 2015-08-31 11:55:39 UTC
When "Preserve paths when extracting" is unchecked, all files are extracted in the root directory, that is almost never the desired behavior. 

I think this is what it boils down to: some archives just exist of a bunch of files and directories, while others define a "root folder" inside the archive. I'm not sure, but I think that many compression tools create this root folder by default, even though you are only selecting files for compression instead of a folder.

When extracted without "Extract into subfolder", the latter type of archive will still appear as if it was extracted into a subfolder, because the "root folder" of the archive is the folder where all the files are in. But when "Extract into subfolder" is enabled, that root folder (which is mostly the same as the name of the archive), will appear twice.

Hopefully you understand what I mean. It's possible that the functions are implemented correctly, but just behave different from how all other extraction tools I've used before behave. I noticed that because it annoyed me, that's the reason I filed this issue.
Comment 4 Ragnar Thomsen 2015-08-31 15:28:25 UTC
I can't reproduce this with Ark 15.08.0. Can you try with this version?
Comment 5 Steven Roose 2015-08-31 15:59:35 UTC
How can I upgrade to that version? I'm on 2.19 now...
Comment 6 Ragnar Thomsen 2015-08-31 16:59:06 UTC
(In reply to Steven Roose from comment #5)
> How can I upgrade to that version? I'm on 2.19 now...

Is it not packaged for Fedora?
Comment 7 Steven Roose 2015-08-31 17:07:46 UTC
Created attachment 94308 [details]
attachment-28056-0.html

Well, I'm on the latest version on Fedora...

On Mon, Aug 31, 2015 at 6:59 PM, Ragnar Thomsen <rthomsen6@gmail.com> wrote:

> https://bugs.kde.org/show_bug.cgi?id=351593
>
> --- Comment #6 from Ragnar Thomsen <rthomsen6@gmail.com> ---
> (In reply to Steven Roose from comment #5)
> > How can I upgrade to that version? I'm on 2.19 now...
>
> Is it not packaged for Fedora?
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
>
Comment 8 Hans Überacher 2016-02-20 18:09:36 UTC
I get the same behavior in Ark 15.08.2 (Kubuntu 15.10). "Preserve Paths" is unchecked, "Subfolder" is unchecked, yet the folder structure is preserved when I extract a single file.
Comment 9 Elvis Angelaccio 2016-03-04 10:24:49 UTC
(In reply to Hans Überacher from comment #8)
> I get the same behavior in Ark 15.08.2 (Kubuntu 15.10). "Preserve Paths" is
> unchecked, "Subfolder" is unchecked, yet the folder structure is preserved
> when I extract a single file.

Which archive format (tar, zip, ...) were you using?
Comment 10 Elvis Angelaccio 2016-03-14 12:16:15 UTC
(In reply to Steven Roose from comment #3)

> When extracted without "Extract into subfolder", the latter type of archive
> will still appear as if it was extracted into a subfolder, because the "root
> folder" of the archive is the folder where all the files are in.

This is the intended behavior. If the archive has a root folder and if you are preserving the paths, then the root folder will occur in the extracted path, because it's just a normal folder.

> But when
> "Extract into subfolder" is enabled, that root folder (which is mostly the
> same as the name of the archive), will appear twice.

This is also intentional, although I'd agree that it doesn't make much sense.

> 
> Hopefully you understand what I mean. It's possible that the functions are
> implemented correctly, but just behave different from how all other
> extraction tools I've used before behave. I noticed that because it annoyed
> me, that's the reason I filed this issue.

So, what you really want is the following feature/option: "always discard the root folder if it has the same name of the archive".
If you can confirm this, I will mark this report as whish instead of bug.


@Hans Überacher: please open another report for your issue.
Comment 11 Elvis Angelaccio 2016-04-11 09:53:33 UTC
@Steven: can you confirm my previous comment?
Comment 12 Elvis Angelaccio 2016-07-13 09:31:41 UTC
Waiting for more info.
Comment 13 Andrew Crouthamel 2018-09-26 22:21:43 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 14 Andrew Crouthamel 2018-10-27 04:03:13 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!