far2l icon indicating copy to clipboard operation
far2l copied to clipboard

Unzip with parent directory

Open Pensionarspoolen opened this issue 4 years ago • 14 comments

My .zip file (project.zip) has this directory structure. | aptgroup - iscala2uno | connect - obclock | ...

I navigate to the aptgroup directory and select the iscala2uno directory, and then press F5 to copy. It unzips the aptgroup directory (but not the files inside it) and the iscala2uno inside it. I would assume it should unzip only the iscala2uno directory and NOT its parent directory also! Same with the connect directory above.

Is this normal, is this something I could change myself?

Pensionarspoolen avatar Feb 28 '21 17:02 Pensionarspoolen

No its not normal. its old good bug.

elfmz avatar Feb 28 '21 17:02 elfmz

Ok, nice to know. Can I modify the settings or is it in the source?

Pensionarspoolen avatar Feb 28 '21 18:02 Pensionarspoolen

I dont think so. The problem that multiarc uses external unarchivers to extract files and typically there two possibilities: extract with full pathes and extract without pathes. And what you want is in the middle. However, since multiarc started to be unpacking engine too by using libarchive, that can be workarounded for formats extracted by libarchive, including zip. And i've just commited workaround. Note that if you've changed some archivers command lines in multiarc settings you might have to reset that settings.

elfmz avatar Feb 28 '21 20:02 elfmz

Great :-) Then I'll just look forward to the next Alpha in my update manager. Btw, It works the right way i FAR3 on Windows, maybe they coded the same workaround :).

Pensionarspoolen avatar Feb 28 '21 20:02 Pensionarspoolen

FAR3 by default has ArcLite that is unarchiver by itself and thus also not limited by 3rd-party tools abilities.

elfmz avatar Feb 28 '21 20:02 elfmz

I have to thank give a huge thanks to you and the other contributors! Moving to a Linux machine after using far-manager for years and finding mc... Not that mc is bad, but my fingers are used to certain keystrokes. Huge thanks!

Pensionarspoolen avatar Feb 28 '21 20:02 Pensionarspoolen

Yet another dup of #191? :)

unxed avatar Feb 28 '21 21:02 unxed

And what you want is in the middle.

Can't we just do mv afterwards by ourselfs for such archivers? :)

unxed avatar Feb 28 '21 21:02 unxed

I had same idea but problem that it theoretically may overlap existing directory and following mv will move all together thats would be not very good.

elfmz avatar Feb 28 '21 21:02 elfmz

I had same idea but problem that it theoretically may overlap existing directory and following mv will move all together thats would be not very good.

So can we do this only then there is surely no existing directory with the same name?

unxed avatar Feb 28 '21 21:02 unxed

..too tricky

elfmz avatar Feb 28 '21 21:02 elfmz

I would say that if you're extracting a file/directory A into directory D which has A already, then you're making a conscious decision to overwrite the existing A. Or maybe even get the usual "Overwrite?" prompt when moving A into D.

singalen avatar Mar 01 '21 03:03 singalen

However, since multiarc started to be unpacking engine too by using libarchive, that can be workarounded for formats extracted by libarchive, including zip. And i've just commited workaround.

arclite (that handles paths correctly) uses 7zip internally. We also use 7zip sources for 7z format. Aren't they capable to do the trick as libarchive does?

unxed avatar Mar 01 '21 10:03 unxed

FYI, arclite is now available also: https://github.com/elfmz/far2l/pull/2670

unxed avatar Feb 17 '25 20:02 unxed