From jhs@FreeBSD.ORG Wed Oct 15 12:48:21 1997 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 Subject: diff -c for src/gnu/usr.bin/tar/tar.c FreeBSD 2.2.2-RELEASE X-Send-Pr-Version: 3.2 >Number: 4771 >Category: gnu >Synopsis: diff to correct misleading total bytes info. >Confidential: no >Severity: non-critical >Priority: low >Responsible: ceri >State: closed >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Oct 15 12:50:01 PDT 1997 >Closed-Date: Sun Jun 08 11:03:58 PDT 2003 >Last-Modified: Sun Jun 08 11:03:58 PDT 2003 >Originator: Julian Stacey >Release: FreeBSD 2.2.2-RELEASE i386 >Organization: >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 >Release-Note: >Audit-Trail: State-Changed-From-To: open->feedback State-Changed-By: schweikh State-Changed-When: Tue Aug 13 11:53:57 PDT 2002 State-Changed-Why: Julian, does this also happen with the latest tar on 5-current? http://www.freebsd.org/cgi/query-pr.cgi?pr=4771 State-Changed-From-To: feedback->closed State-Changed-By: ceri State-Changed-When: Sun Jun 8 11:03:56 PDT 2003 State-Changed-Why: Feedback timeout (6 months or more). I will handle any feedback that this closure generates. Responsible-Changed-From-To: freebsd-bugs->ceri Responsible-Changed-By: ceri Responsible-Changed-When: Sun Jun 8 11:03:56 PDT 2003 Responsible-Changed-Why: Feedback timeout (6 months or more). I will handle any feedback that this closure generates. http://www.freebsd.org/cgi/query-pr.cgi?pr=4771 >Unformatted: