-
-
Notifications
You must be signed in to change notification settings - Fork 392
Is it possible to support 7z archive? #53
Comments
If there's a pure-Go way to do it, sure thing -- contributions welcome! |
Cool; looks like read-only currently, though. |
Well, original 7-zip has become available for Linux since March 2021, let’s not fall behind. |
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. |
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. |
It seems like there's a library for 7z in go now: https://github.com/bodgit/sevenzip |
Huh, nice! Will look more when I'm not mobile. |
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 ! |
Wow that was fast! You are welcome 😊 |
Dear @mholt, is there a Windows binary of Archiver with 7z support? |
@sergeevabc Archiver v4 does not have any command yet, for any OS; it's just a library for now. |
I find that this package has a reference to lzma.
The text was updated successfully, but these errors were encountered: