feat: lz and lz4 archives support#3451
Conversation
|
Thanks for the patch! A few questions:
|
|
@sxyazi, I tested the real MIME types for .lz and .lz4 $ tar --lzip -cf archive.tar.lz file.pdf
$ file --mime-type ./archive.tar.lz4
./archive.tar.lz4: application/x-lz4
$ tar -cvf - file.pdf | lz4 > archive.tar.lz4
$ file --mime-type ./archive.tar.lz
./archive.tar.lz: application/x-lzipHere are files examples: archive.tar.lz, archive.tar.lz4 Also I reworked the fix to use these MIME types. The one thing I'm not sure about is the diff in yazi-plugin/preset/plugins/extract.lua. |
|
I tried lz and lz4 previews with this PR, but it errors out: And when I extract lz and lz4 files encountered the same |
|
Are you using ouch for this? |
|
No I'm using 7zip. Run |
|
Then something wrong with 7zz. lz4 and lzip support it: $ lz4 -d ./archive.tar.lz4
Decoding file ./archive.tar
./archive.tar.lz4 : decoded 593920 bytes
$ lzip -dk ./archive.tar.lz
$ ls -la ./archive.tar
-rw-r--r--@ 1 y staff 586240 Dec 23 11:45 ./archive.tarLatest ouch (nightly build from main branch) supports it: $ ouch list ./archive.tar.lz4
Archive: /Users/y/Downloads/archive.tar.lz4
._p1539-orlov.pdf
p1539-orlov.pdf
$ ouch list ./archive.tar.lz
Archive: /Users/y/Downloads/archive.tar.lz
._p1539-orlov.pdf
p1539-orlov.pdf7z also handles .lz (lzip) and .lz4 correctly: $ 7z l ./archive.tar.lz
7-Zip [64] 17.05 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
p7zip Version 17.05 (locale=utf8,Utf16=on,HugeFiles=on,64 bits,14 CPUs LE)
Scanning the drive for archives:
1 file, 575105 bytes (562 KiB)
Listing archive: ./archive.tar.lz
--
Path = ./archive.tar.lz
Type = lzip
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
..... archive.tar
------------------- ----- ------------ ------------ ------------------------
575105 1 files$ 7z l ./archive.tar.lz4
7-Zip [64] 17.05 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
p7zip Version 17.05 (locale=utf8,Utf16=on,HugeFiles=on,64 bits,14 CPUs LE)
Scanning the drive for archives:
1 file, 580099 bytes (567 KiB)
Listing archive: ./archive.tar.lz4
--
Path = ./archive.tar.lz4
Type = lz4
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
..... archive.tar
------------------- ----- ------------ ------------ ------------------------
580099 1 files |
|
What’s the point of adding lz4 and lzip as the supported formats if 7zz
(the tool Yazi uses for archive previewing and extracting) doesn’t work
with them at all?
…On Tue, Dec 23, 2025 at 5:58 PM yh-sb ***@***.***> wrote:
*yh-sb* left a comment (sxyazi/yazi#3451)
<#3451 (comment)>
Then something wrong with 7zz.
*lz4* and *lzip* support it:
$ lz4 -d ./archive.tar.lz4
Decoding file ./archive.tar
./archive.tar.lz4 : decoded 593920 bytes
$ lzip -dk ./archive.tar.lz
$ ls -la ./archive.tar
-rw-r--r--@ 1 y staff 586240 Dec 23 11:45 ./archive.tar
Latest *ouch* *(nightly build from main branch)* supports it:
$ ouch list ./archive.tar.lz4
Archive: /Users/y/Downloads/archive.tar.lz4
._p1539-orlov.pdf
p1539-orlov.pdf
$ ouch list ./archive.tar.lz
Archive: /Users/y/Downloads/archive.tar.lz
._p1539-orlov.pdf
p1539-orlov.pdf
—
Reply to this email directly, view it on GitHub
<#3451 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEFWFICMUBS3GPLD6GDJSHT4DEG5NAVCNFSM6AAAAACPT3CDKGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMOBWGAYDQNBXGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
I didn't know yazi used 7zz. |
|
Closing in that case, thank you for the effort anyway! |
I created a fix for 7zz to support .lz and .lz4: ip7z/7zip#177. When it will be merged - we can come back to this PR in yazi. |
Which issue does this PR resolve?
Add support of .lz and .lz4 archives
Rationale of this PR
.lz and .lz4 should be supported as well as others