Utility to decompress gz files, when gunzip says "unrecognized file format"

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Utility to decompress gz files, when gunzip says "unrecognized file format"

Brett Mahar-2
Hi,

Occasionally when I download a file with gz extension, it fails to
extract when I run: "gunzip filename".

eg I just downloaded a compressed gz document about "make":
ftp://ftp.netbsd.org/pub/NetBSD/misc/lite2-docs/psd/12.make.ps.gz

$ gunzip 12.make.ps.gz
gunzip: 12.make.ps.gz: unrecognized file format

Same thing happens with .pdf.gz files.

If I gzip and then gunzip a file myself, it works no problem, so I am
assuming that files such as the one above have been compressed using gnu
extensions or something similar which is incompatible with the OpenBSD
gunzip.

I tried installing archivers/deco from ports and got:

$ deco 12.make.ps.gz
gunzip: ./12.make.ps.gz not a regular file: unchanged
deco: could not extract archive: 12.make.ps.gz
deco: empty archive: 12.make.ps.gz

I have gone through all the man pages I could find and the misc archives
and could not find mention of any utility that will handle these cases.

Is there another utility or command I can try that will extract these
uncooperative files?

Thanks,
Brett.

Reply | Threaded
Open this post in threaded view
|

Re: Utility to decompress gz files, when gunzip says "unrecognized file format"

Claudio Jeker
On Wed, Aug 10, 2011 at 12:21:26PM -0700, Brett wrote:

> Hi,
>
> Occasionally when I download a file with gz extension, it fails to
> extract when I run: "gunzip filename".
>
> eg I just downloaded a compressed gz document about "make":
> ftp://ftp.netbsd.org/pub/NetBSD/misc/lite2-docs/psd/12.make.ps.gz
>
> $ gunzip 12.make.ps.gz
> gunzip: 12.make.ps.gz: unrecognized file format
>
> Same thing happens with .pdf.gz files.
>
> If I gzip and then gunzip a file myself, it works no problem, so I
> am assuming that files such as the one above have been compressed
> using gnu extensions or something similar which is incompatible with
> the OpenBSD gunzip.
>
> I tried installing archivers/deco from ports and got:
>
> $ deco 12.make.ps.gz
> gunzip: ./12.make.ps.gz not a regular file: unchanged
> deco: could not extract archive: 12.make.ps.gz
> deco: empty archive: 12.make.ps.gz
>
> I have gone through all the man pages I could find and the misc
> archives and could not find mention of any utility that will handle
> these cases.
>
> Is there another utility or command I can try that will extract
> these uncooperative files?
>

They are already uncompressed by a greedy broswer but the name was not
changed to reflect this. It is normaly a configuration issue of the
webserver telling the browser to uncompress on the fly.

--
:wq Claudio

Reply | Threaded
Open this post in threaded view
|

Re: Utility to decompress gz files, when gunzip says "unrecognized file format"

Ted Unangst-6
In reply to this post by Brett Mahar-2
On Wed, Aug 10, 2011, Brett wrote:

> Hi,
>
> Occasionally when I download a file with gz extension, it fails to
> extract when I run: "gunzip filename".
>
> eg I just downloaded a compressed gz document about "make":
> ftp://ftp.netbsd.org/pub/NetBSD/misc/lite2-docs/psd/12.make.ps.gz
>
> $ gunzip 12.make.ps.gz
> gunzip: 12.make.ps.gz: unrecognized file format

First thing to do is make sure your compressed file is really
compressed.  If I download that file with ftp I can decompress it just
fine.

Reply | Threaded
Open this post in threaded view
|

Re: Utility to decompress gz files, when gunzip says "unrecognized file format"

Brett Mahar-2
>> Occasionally when I download a file with gz extension, it fails to
>> extract when I run: "gunzip filename".
>>

Thanks for the quick replies, it was a combination of

a) the browser was decompressing the file during download
and
b) it did not download properly (first file was 1.5kb instead of 97kb)

Brett.

Reply | Threaded
Open this post in threaded view
|

Re: Utility to decompress gz files, when gunzip says "unrecognized file format"

Darrin Chandler
In reply to this post by Brett Mahar-2
On Wed, Aug 10, 2011 at 12:21:26PM -0700, Brett wrote:
> ftp://ftp.netbsd.org/pub/NetBSD/misc/lite2-docs/psd/12.make.ps.gz
>
> $ gunzip 12.make.ps.gz
> gunzip: 12.make.ps.gz: unrecognized file format

You might try the 'file' command on your file to see what an independent
identification says. I'm guessing it'll be a plain ps file.

--
http://code.phxbsd.com/