This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: tar zxvf won't work with Redhat generated compressed tar file


The 'file' command isn't recursive.  If you gzip a tar file, it will only say it's a compressed file, it won't say it's a compressed tar file.  See the example I posted myself earlier in the thread.

I had theorized that the original file is zipped, not gzipped, and perhaps the tar command is failing for that reason, but I did some tests with that assumption and it seems tar is able to uncompress a 'zip' format as well as a 'gzip' format.

I really don't have an explanation why tar can't uncompress the file itself, unless (and this is a wild guess on my part) the method used to copy the file from RedHat to Cygwin introduced newline format issues (linux \n vs Windows \r\n).  But that doesn't explain to me why manually gunzip before tar works, while tar alone doesn't.

Is this compressed file under discussion something that can be shared?  I think it will be useful to see if anyone else running 64bit Cygwin (which I am) can handle that file, or is it an issue limited to this one machine?  The Cygwin packages are usually pretty good about getting dependencies installed correctly.  I asked ldd for a list of library references for tar and gzip, and neither one referenced libz, which makes me presume they're both statically linked binaries.  If so, it wouldn't matter if libz is installed or not.

$ ldd /usr/bin/tar
        ntdll.dll => /cygdrive/c/Windows/SYSTEM32/ntdll.dll (0x7ffe15a90000)
        KERNEL32.DLL => /cygdrive/c/Windows/system32/KERNEL32.DLL (0x7ffe134d0000)
        KERNELBASE.dll => /cygdrive/c/Windows/system32/KERNELBASE.dll (0x7ffe12ff0000)
        cygwin1.dll => /usr/bin/cygwin1.dll (0x180040000)
        cygiconv-2.dll => /usr/bin/cygiconv-2.dll (0x3fc6d0000)
        cygintl-8.dll => /usr/bin/cygintl-8.dll (0x3fad80000)

$ ldd /usr/bin/gzip
        ntdll.dll => /cygdrive/c/Windows/SYSTEM32/ntdll.dll (0x7ffe15a90000)
        KERNEL32.DLL => /cygdrive/c/Windows/system32/KERNEL32.DLL (0x7ffe134d0000)
        KERNELBASE.dll => /cygdrive/c/Windows/system32/KERNELBASE.dll (0x7ffe12ff0000)
        cygwin1.dll => /usr/bin/cygwin1.dll (0x180040000)

So, I'm back to asking, how is this file being created on redhat?  There are a multitude of options to tar, and some of them are incompatible with Cygwin, I think.

-----Original Message-----
From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com] On Behalf Of Bertrand Caplet
Sent: Monday, April 20, 2015 14:42
To: cygwin@cygwin.com
Subject: Re: tar zxvf won't work with Redhat generated compressed tar file

> Ran this command on Cygwin64
> 
> $file mytar.gz
> mytar.gz: gzip compressed data, from Unix
> 
> Did you want  me to run this command on Linux?
> 
> Thanks

Well as I said it's a gzip archive not a tar + gzip you can't extract it with tar.
--
CHUNKZ.NET - script kiddie and computer technician Bertrand Caplet, Flers (FR) Feel free to send encrypted/signed messages Key ID: 37F70C30 GPG FP: 134A 4027 518B 5F4D D409 558D BA9B 7BF0 37F7 0C30


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]