The compressed file cannot be decompressed by lzma command on Mac OS
See original GitHub issueI’m using LZMA-JS on nodejs, my code is as below
var my_lzma = require("lzma");
var fs = require('fs');
var result = my_lzma.compress('123456789qwertyuiop');
fs.writeFileSync('b.txt', new Buffer(result, 'ascii'), null, 'b');
then, I renamed “b.txt” to “b.txt.lzma” and tried to use lzma command to decompress it. but I only get the error message
lzma: b2.txt.lzma: Compressed data is corrupt
LZMA-JS and lzma command both are based on the same algorithm, from my understanding, lzma can decompress the file that is compressed by LZMA-JS, am I right? So could you please help me to find out the problem that why the file get decompressed failed? Thanks
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
Compress and uncompress file archives in Terminal on Mac
In Terminal, you can use the GNU tar command to compress and uncompress files and folders. The usual file extension for a compressed...
Read more >The compressed file cannot be decompressed by lzma command on ...
I'm using LZMA-JS on nodejs, my code is as below var my_lzma = require("lzma"); var fs = require('fs'); var result = my_lzma.compress('123456789qwertyuiop') ...
Read more >macos - Does OSX 10.10.4 support LZMA compression at the ...
From the command line, I would like to compress some database dumps using the LZMA algorithm. And, OSX adds XZ support (written in...
Read more >lzma(1) [osx man page] - The UNIX and Linux Forums
xz, unxz, xzcat, lzma, unlzma, lzcat - Compress or decompress .xz and .lzma files SYNOPSIS xz [option...] [file...] COMMAND ALIASES
Read more >Compress and decompress files using AppleArchive
Support in Apple's bundled Archive Utility is incomplete. That app happily decompresses LZFSE .aar archives, and I suspect the version shipped ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m late to the party but you can do this:
I’d prefer not to do anything without @nmrugg’s input but I think LZMA-JS is wrongly writing the end-of-payload marker to the compressed stream even though the compressed size is known. That should not be allowed according to the docs (ref), and commenting out the call to
$WriteEndMarker
seems to solve this problem.