Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Is it possible to support 7z archive? #53

Closed
XiaoMouR opened this issue Dec 26, 2017 · 11 comments
Closed

Is it possible to support 7z archive? #53

XiaoMouR opened this issue Dec 26, 2017 · 11 comments

Comments

@XiaoMouR
Copy link

I find that this package has a reference to lzma.

@mholt
Copy link
Owner

mholt commented Nov 7, 2018

If there's a pure-Go way to do it, sure thing -- contributions welcome!

@mholt
Copy link
Owner

mholt commented Jan 19, 2021

Cool; looks like read-only currently, though.

@sergeevabc
Copy link

sergeevabc commented Apr 18, 2021

Well, original 7-zip has become available for Linux since March 2021, let’s not fall behind.

@coolaj86
Copy link
Collaborator

coolaj86 commented Apr 19, 2021

7z is supported natively by the MacOS Finder as of Catalina... but not the CLI. However, you can get unxz via brew.

7z is worse than USB 3 - too many variations that aren't well standardized or supported.

It's also architecture dependent (meaning endianness sometimes matters). I investigated this heavily and was not able to find any reasonable cross-platform solution in Go, or otherwise.

I did manage to "fix" a bug in one of the popular-ish Go 7z/xz libraries, but the funny thing is that it actually still returns success sometimes when it fails due to improper error handling in the C code.

I would love for someone to come up with a solution for this, but for those that are frustrated just know that it is no where near as easy as it would seem. 7z is "open source" in name, but for whatever reason, very few seem to know how to implement it.

@mholt
Copy link
Owner

mholt commented Jan 30, 2022

Thanks AJ. Closing this issue for now, as it seems there aren't great pure-Go solutions for 7z. Feel free to continue discussion and we can reopen when/if this becomes feasible.

@jmigual
Copy link

jmigual commented Nov 15, 2022

It seems like there's a library for 7z in go now: https://github.com/bodgit/sevenzip

@mholt
Copy link
Owner

mholt commented Nov 15, 2022

Huh, nice! Will look more when I'm not mobile.

@mholt mholt reopened this Nov 18, 2022
@mholt mholt closed this as completed in c207f20 Nov 18, 2022
@mholt
Copy link
Owner

mholt commented Nov 18, 2022

I pushed a very simple, only-lightly-tested commit that implements support for reading 7z files. I only tested it with a simple sample file I found online, but it worked for me.

Not really loving how much the dependency puked all over go.sum and go.mod, but I guess that's what we get for a pure-Go implementation, which I do appreciate.

I'm not a 7z user myself, so any patches or enhancements on this feature should be contributed by others I think.

Thanks for the link, @jmigual !

@jmigual
Copy link

jmigual commented Nov 18, 2022

Wow that was fast! You are welcome 😊

@sergeevabc
Copy link

Dear @mholt, is there a Windows binary of Archiver with 7z support?
Or any estimate when it will be available to the public?

@mholt
Copy link
Owner

mholt commented Nov 18, 2022

@sergeevabc Archiver v4 does not have any command yet, for any OS; it's just a library for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants