Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am going crazy with a gzip file.

I can decompress the file in Windows using WinRAR but it is impossible on any UNIX operating system.

the file seems to be ok. If I do

file the_name_of_the_file.gz

I get:

the_name_of_the_file.gz: gzip compressed data, from Unix, last modified: Sun Jan 30 14:10:21 2011

But if I do

gunzip -f the_name_of_the_file.gz

I alsways get:

gzip: the_name_of_the_file.gz: unexpected end of file

The same problem happens when I try to extract the file using the GUI tool in Ubuntu or MacOSX,

Any ideas?

share|improve this question

migrated from stackoverflow.com May 4 '11 at 19:42

This question came from our site for professional and enthusiast programmers.

    
Is it the same exact file (i.e. You have it on a flash drive and have opened it up from the two operating systems) or are you downloading it individually? If the later, you could have an incomplete download that doesn't have all of the data (aka, corrupt). –  Xan May 4 '11 at 18:56
1  
The file command won't check all of the file. It'll just look at a few bytes in the header to figure out that it's a gz encoded file. –  James C May 4 '11 at 19:00
    
It is not corrupted because I have tried first in Unix and later in Windows. –  cues7a May 4 '11 at 19:00

4 Answers 4

Did you by any chance transfer the file from Win* to Unix via ftp in ascii mode? That may explain it. Is the file the same size on Win* and Unix?

share|improve this answer
    
I have tried tu decompress the file first in Windows and later in Unix. –  cues7a May 4 '11 at 19:02

I suspect you're corrupting the file when copying it to the *nix machine.

FTP it in binary mode.

share|improve this answer
    
I think the file is not corrupted because I tried to gunzip it fist in unix and later in Windows. –  cues7a May 4 '11 at 19:01
1  
What you are saying makes no sense. If you didn't need to create a copy of the file, then say so. If you did, maybe your copying process (FTP?) was incorrect. –  Robin Green May 4 '11 at 19:11
    
I transfered the file via USB pendrive. I tried first in UNIX and it didn't work and then I tried in Windows and it worked. –  cues7a May 4 '11 at 19:33

I've solved the problem using the utility P7zip, a port of 7za.exe for POSIX systems.

share|improve this answer

Based on a few experiences with WinRar, my first guess is that it's extracting incomplete or corrupted files without giving an error, while gzip is (correctly) giving an error.

What does 7zip make of your file?

What version does gzip -V announce?

What does gzip -t the_name_of_the_file.gz tell you? (probably the same unexpected EOF, but worth a try)

share|improve this answer
    
gzip -V: gzip 1.3.12,, gzip -t the_name_of_the_file -> unexpected EOF –  cues7a May 5 '11 at 6:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.