I have created zlib-compressed data in Python, like this:
import zlib
s = '...'
z = zlib.compress(s)
with open('/tmp/data', 'w') as f:
f.write(z)
(or one-liner in shell: echo -n '...' | python2 -c 'import sys,zlib; sys.stdout.write(zlib.compress(sys.stdin.read()))' > /tmp/data
)
Now, I want to uncompress the data in shell. Neither zcat
nor uncompress
work:
$ cat /tmp/data | gzip -d -
gzip: stdin: not in gzip format
$ zcat /tmp/data
gzip: /tmp/data.gz: not in gzip format
$ cat /tmp/data | uncompress -
gzip: stdin: not in gzip format
It seems that i have created gzip-like file, but without any headers.. unfortunately i don's see any option to uncompress such raw data in gzip man page.. and zlib package does not contain any executable utility..
Is there an utility to uncompress raw zlib data?