From owner-freebsd-bugs Wed Oct 15 12:50:11 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id MAA19713 for bugs-outgoing; Wed, 15 Oct 1997 12:50:11 -0700 (PDT) (envelope-from owner-freebsd-bugs) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id MAA19686; Wed, 15 Oct 1997 12:50:02 -0700 (PDT) (envelope-from gnats) Resent-Date: Wed, 15 Oct 1997 12:50:02 -0700 (PDT) Resent-Message-Id: <199710151950.MAA19686@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, jhs@FreeBSD.ORG Received: from wall.jhs.no_domain (vector.muc.ditec.de [194.120.126.35]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id MAA19375 for ; Wed, 15 Oct 1997 12:47:34 -0700 (PDT) (envelope-from jhs@freebsd.org) Received: (from jhs@localhost) by flip.jhs.no_domain (8.8.5/8.8.5) id PAA20799; Tue, 14 Oct 1997 15:23:21 +0200 (MET DST) Message-Id: <199710141323.PAA20799@flip.jhs.no_domain> Date: Tue, 14 Oct 1997 15:23:21 +0200 (MET DST) From: jhs@FreeBSD.ORG Reply-To: jhs@FreeBSD.ORG To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: gnu/4771: diff -c for src/gnu/usr.bin/tar/tar.c FreeBSD 2.2.2-RELEASE Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 4771 >Category: gnu >Synopsis: diff to correct misleading total bytes info. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Oct 15 12:50:01 PDT 1997 >Last-Modified: >Originator: Julian Stacey >Organization: >Release: FreeBSD 2.2.2-RELEASE i386 >Environment: FreeBSD 2.2.2-RELEASE i386 >Description: Fix for misleading byte count info. from gnu tar. >How-To-Repeat: cd /usr/src/gnu/usr.bin/tar patch -p5 < diff.jhs ; make ; make install tar -c -f - --totals . | dd of=/dev/null tar:Total bytes written: 952320 dd:1860+0 records in dd:1860+0 records out dd:952320 bytes transferred in 0.054882 secs (17352122 bytes/sec) tar -z -c -f - --totals . | dd of=/dev/null tar:Total bytes written: 952320 dd:671+1 records in dd:671+1 records out dd:343978 bytes transferred in 3.607535 secs (95350 bytes/sec) One can see the truth from dd, but tar itself lies to us. My diff changes tar:Total bytes written: 952320 to tar:Total bytes written (to compressor, not to media): 952320 Why I bother to fix it: On another occasion it said ~550M to me when it had really only written ~250M to my tape, as my qic-525 only takes about 540M i thought I'd hit end of tape, not so, gnu tar just misleads us about how much its proxy gzip is writing. >Fix: I'm too busy to change the the code, to count bytes written out from the compressor (I suspect that would be very hard, pipes'nall & anyway it's a 3rd party gnu product. My patch below corrects the information label returned by the command. Appropriate for FreeBSD 2.2.2-RELEASE *** old/src/gnu/usr.bin/tar/tar.c Tue Jan 7 11:44:53 1997 --- new/src/gnu/usr.bin/tar/tar.c Tue Oct 14 14:35:12 1997 *************** *** 230,236 **** case CMD_CREATE: create_archive (); if (f_totals) ! fprintf (stderr, "Total bytes written: %d\n", tot_written); break; case CMD_EXTRACT: if (f_volhdr) --- 230,240 ---- case CMD_CREATE: create_archive (); if (f_totals) ! fprintf (stderr, "Total bytes written%s: %d\n", ! (f_compressprog) ? ! " (to compressor, not to media)" ! : "" , ! tot_written); break; case CMD_EXTRACT: if (f_volhdr) Julian -- Julian H. Stacey Home http://www.freebsd.org/~jhs/ Tel. +49 89 268616 >Audit-Trail: >Unformatted: