delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/08/25/02:12:17

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=3.8 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE
X-Spam-Check-By: sourceware.org
X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-15.arcor-online.net 3FDDD1AB538
From: "Peter" <murrxx3 AT arcor DOT de>
To: <cygwin AT cygwin DOT com>
Subject: gzip 1.4-1 creates corrupt archive
Date: Sat, 25 Aug 2012 08:11:47 +0200
Message-ID: <98106E7FBCC84B84880593C9916C9502@AMIGIME>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

To trim a log file on my windows box I tried the lines below in a bash
script. (my bash is 4.1.10(4))
 
cat "$LOG" | gzip > "$LOG.old.gz"
> "$LOG"
 
The resulting archive was corrupt.
Directly compressing like  gzip "$LOG"  works OK but is not suitable in my
case as the logging service constantly writes to the file
I also tried the -c and -a options of gzip but did not succeed.
From my investigation I suspect there is something with textmode and binmode
but I do not fully understand how to deal with it.
 
What I finally found is that bzip2 works in the above line.
So my solution is to use bzip2 instead of gzip.
 
So my question is:  why can't  gzip  do it automatically if bzip2 can?
 
 


--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019