From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17004 invoked by alias); 25 Aug 2012 06:12:06 -0000 Received: (qmail 16994 invoked by uid 22791); 25 Aug 2012 06:12:04 -0000 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 Received: from mail-in-12.arcor-online.net (HELO mail-in-12.arcor-online.net) (151.189.21.52) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 25 Aug 2012 06:11:51 +0000 Received: from mail-in-20-z2.arcor-online.net (mail-in-20-z2.arcor-online.net [151.189.8.85]) by mx.arcor.de (Postfix) with ESMTP id D987726DE3 for ; Sat, 25 Aug 2012 08:11:49 +0200 (CEST) Received: from mail-in-15.arcor-online.net (mail-in-15.arcor-online.net [151.189.21.55]) by mail-in-20-z2.arcor-online.net (Postfix) with ESMTP id D81546FA568 for ; Sat, 25 Aug 2012 08:11:49 +0200 (CEST) Received: from AMIGIME (dslb-088-067-141-147.pools.arcor-ip.net [88.67.141.147]) (Authenticated sender: peter.kielbasiewicz@arcor.de) by mail-in-15.arcor-online.net (Postfix) with ESMTPA id 3FDDD1AB538 for ; Sat, 25 Aug 2012 08:11:49 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-15.arcor-online.net 3FDDD1AB538 From: "Peter" To: Subject: gzip 1.4-1 creates corrupt archive Date: Sat, 25 Aug 2012 11:18:00 -0000 Message-ID: <98106E7FBCC84B84880593C9916C9502@AMIGIME> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2012-08/txt/msg00569.txt.bz2 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