Date: Sun, 07 Mar 2010 19:52:48 +0100 From: "Philippe Pepiot" <phil@philpep.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/144531: [PATCH] bin/cp show percentage complete Message-ID: <20100307185250.01BC51065677@hub.freebsd.org> Resent-Message-ID: <201003071900.o27J02aO086729@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 144531 >Category: bin >Synopsis: [PATCH] bin/cp show percentage complete >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Mar 07 19:00:01 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Philippe Pepiot >Release: FreeBSD 8.0-RELEASE-p2 i386 >Organization: >Environment: System: FreeBSD shen.philpep.org 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0 r202418: Fri Jan 15 22:29:53 CET 2010 root@shen.philpep.org:/usr/obj/usr/src/sys/SHEN i386 >Description: When use the -v (verbose) option, show progress complete. >How-To-Repeat: >Fix: --- cp-show-progress.patch begins here --- Index: utils.c =================================================================== --- utils.c (revision 204841) +++ utils.c (working copy) @@ -216,6 +216,11 @@ entp->fts_path, to.p_path, cp_pct(wtotal, fs->st_size)); } + if (vflag) + (void)fprintf(stderr, + "%s -> %s %3d%%\033[0G", + entp->fts_path, to.p_path, + cp_pct(wtotal, fs->st_size)); if (wcount >= (ssize_t)wresid) break; } Index: cp.c =================================================================== --- cp.c (revision 204841) +++ cp.c (working copy) @@ -481,7 +481,7 @@ break; } if (vflag && !badcp) - (void)printf("%s -> %s\n", curr->fts_path, to.p_path); + (void)printf("%s -> %s 100%%\n", curr->fts_path, to.p_path); } if (errno) err(1, "fts_read"); --- cp-show-progress.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100307185250.01BC51065677>