gunzip

is partial gz decompression possible?

自闭症网瘾萝莉.ら 提交于 2019-11-29 14:51:36
问题 For working with images that are stored as .gz files (my image processing software can read .gz files for shorter/smaller disk time/space) I need to check the header of each file. The header is just a small struct of a fixed size at the start of each image, and for images that are not compressed, checking it is very fast. For reading the compressed images, I have no choice but to decompress the whole file and then check this header, which of course slows down my program. Would it be possible

How to get few lines from a .gz compressed file without uncompressing

我们两清 提交于 2019-11-28 15:28:10
问题 How to get the first few lines from a gziped file ? I tried zcat, but its throwing an error zcat CONN.20111109.0057.gz|head CONN.20111109.0057.gz.Z: A file or directory in the path name does not exist. 回答1: zcat(1) can be supplied by either compress(1) or by gzip(1) . On your system, it appears to be compress(1) -- it is looking for a file with a .Z extension. Switch to gzip -cd in place of zcat and your command should work fine: gzip -cd CONN.20111109.0057.gz | head Explanation -c --stdout -

Uncompress a gzip file from CURL, on php

时间秒杀一切 提交于 2019-11-27 21:52:44
Does anyone know how to uncompress the contents of a gzip file that i got with curl? for example: http://torcache.com/torrent/63ABC1435AA5CD48DCD866C6F7D5E80766034391.torrent responded HTTP/1.1 200 OK Server: nginx Date: Wed, 09 Jun 2010 01:11:26 GMT Content-Type: application/x-bittorrent Content-Length: 52712 Last-Modified: Tue, 08 Jun 2010 15:09:58 GMT Connection: keep-alive Expires: Fri, 09 Jul 2010 01:11:26 GMT Cache-Control: max-age=2592000 Content-Encoding: gzip Accept-Ranges: bytes then the compressed gzip, i tried gzdecode but doesn't work , gzeflate as well doesn't they simply don't

How to check if a Unix .tar.gz file is a valid file without uncompressing?

若如初见. 提交于 2019-11-27 06:19:57
I have found the question How to determine if data is valid tar file without a file? , but I was wondering: is there a ready made command line solution? What about just getting a listing of the tarball and throw away the output, rather than decompressing the file? tar -tzf my_tar.tar.gz >/dev/null Edited as per comment. Thanks zrajm! Edit as per comment. Thanks Frozen Flame! This test in no way implies integrity of the data. Because it was designed as a tape archival utility most implementations of tar will allow multiple copies of the same file! John Boker you could probably use the gzip -t

How to check if a Unix .tar.gz file is a valid file without uncompressing?

断了今生、忘了曾经 提交于 2019-11-26 11:56:24
问题 I have found the question How to determine if data is valid tar file without a file?, but I was wondering: is there a ready made command line solution? 回答1: What about just getting a listing of the tarball and throw away the output, rather than decompressing the file? tar -tzf my_tar.tar.gz >/dev/null Edited as per comment. Thanks zrajm! Edit as per comment. Thanks Frozen Flame! This test in no way implies integrity of the data. Because it was designed as a tape archival utility most