Progress reporting: N more to check
jw schultz
jw at pegasys.ws
Tue Jan 13 07:46:05 GMT 2004
On Mon, Jan 12, 2004 at 10:37:40PM -0800, Wayne Davison wrote:
> A recent posting here got me thinking about having the --progress
> output tell the user about how many files were left to go in the
> transfer. I submit the attached patch which outputs an extra suffix
> onto the progress line at the end of each file's transfer (so it
> only appears once per file, not on every status update). The output
> would look like this:
>
> [...]
> flist.c
> 35671 100% 6.67MB/s 0:00:00 (#3; 262 more to check)
> flist.o
> 87288 100% 4.59MB/s 0:00:00 (#4; 261 more to check)
> log.c
> 13812 100% 12.50MB/s 0:00:00 (#5; 221 more to check)
> [...]
>
> The "to check" part is perhaps a little verbose, but it helps to
> alert the user that we're not talking about how many files are left
> to transfer (since we won't know that number until we check them)
> and the "more" number will often not go down to zero (if the final
> file in the list is up-to-date).
>
> Thoughts? Suggestions?
Seems over-complicated to me.
How about "(%d of %d files)\n", cur_index, flist->count;
For that you just need cur_index to come from i in
recv_files() or send_file();
That gives index into flist as it is being walked.
If you wanted to have something more complicated i'd go with
using bytecounts of transferred plus skipped as a percentage
of total so when complete it would be 100%
--
________________________________________________________________
J.W. Schultz Pegasystems Technologies
email address: jw at pegasys.ws
Remember Cernan and Schmitt
More information about the rsync
mailing list