public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* gzip 1.4-1 creates corrupt archive
@ 2012-08-25 11:18 Peter
  2012-08-26  3:49 ` K Stahl
  2012-08-28  2:43 ` Warren Young
  0 siblings, 2 replies; 8+ messages in thread
From: Peter @ 2012-08-25 11:18 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-08-27 18:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-25 11:18 gzip 1.4-1 creates corrupt archive Peter
2012-08-26  3:49 ` K Stahl
2012-08-26  4:39   ` Ryan Johnson
2012-08-26  6:25     ` K Stahl
2012-08-27 13:06       ` Earnie Boyd
2012-08-27 14:08         ` Ryan Johnson
2012-08-28  0:09           ` KHMan
2012-08-28  2:43 ` Warren Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).