Operating System - HP-UX
1837178 Members
2700 Online
110113 Solutions
New Discussion

Re: corrupted gzip, viewed on Windows

 
Vittorio_3
Advisor

corrupted gzip, viewed on Windows

Hi, all
I work with text file, trying to compress it and then ftp to windows for review:
# gzip file1
# ftp file1.gz
I know that Winzip understands gzip files perfectly, but in my case output looks corrupted, I see some lines multiplied and broken in the middle. I don???t think that it???s any problem with ftp, as size is same, but suspect gzip. There is no any non-readable chars in file, there are spaces in the middle of lines. Tried to see in Notepad, word, Excel, all the same. Also tried ux2dos (no result)
Will appreciate any info.


Line111111111111111111111111111 (input)
Line222222222 22222222222222222
Line333333 33333333333333333333
Line444444444 44444444444444444
Line5555555555555555 5555555555
Line666666666666666666666666666


Line111111111111111111111111111 (output)
Line222222222222222222222222222
Line333333333333333333333333333
Line444444444444444 Line3333333333444444444444
Line555555555555555555333 33444444444444555555555
Line66666666666666 Line4444446666666666666??????.
2 REPLIES 2
Brian Bergstrand
Honored Contributor

Re: corrupted gzip, viewed on Windows

make sure to transfer the gzip file as binary, otherwise the ftp client will do unix -> windows line endings translation and corrupt the gzip file.

ftp> bin
ftp> get
A. Clay Stephenson
Acclaimed Contributor

Re: corrupted gzip, viewed on Windows

If the problem were in decompression, your files would be much, much more distorted than they are. The problem is almost certainly CR/LF's. You need to run the ux2dos command on each file BEFORE you zip and then then transfer the file using binary FTP. You could, of course, script the transfer of all these files as ASCII ftp and that should be fine as well.
If it ain't broke, I can fix that.