- /* Amanda 2.4.1p1 looks for "Total bytes written: [0-9][0-9]*". */
- fprintf (stderr, _("Total bytes written: %s (%s, %s/s)\n"), bytes,
- human_readable (written, abbr, human_opts, 1, 1),
- (0 < duration && written / duration < (uintmax_t) -1
- ? human_readable (written / duration, rate, human_opts, 1, 1)
- : "?"));
+ fprintf (fp, "%s: %s (%s, %s/s)\n",
+ text, bytes,
+ human_readable (numbytes, abbr, human_opts, 1, 1),
+ (0 < duration && numbytes / duration < (uintmax_t) -1
+ ? human_readable (numbytes / duration, rate, human_opts, 1, 1)
+ : "?"));
+}
+
+void
+print_total_stats ()
+{
+ switch (subcommand_option)
+ {
+ case CREATE_SUBCOMMAND:
+ case CAT_SUBCOMMAND:
+ case UPDATE_SUBCOMMAND:
+ case APPEND_SUBCOMMAND:
+ /* Amanda 2.4.1p1 looks for "Total bytes written: [0-9][0-9]*". */
+ print_stats (stderr, _("Total bytes written"),
+ prev_written + bytes_written);
+ break;
+
+ case DELETE_SUBCOMMAND:
+ {
+ char buf[UINTMAX_STRSIZE_BOUND];
+ print_stats (stderr, _("Total bytes read"),
+ records_read * record_size);
+ print_stats (stderr, _("Total bytes written"),
+ prev_written + bytes_written);
+ fprintf (stderr, _("Total bytes deleted: %s\n"),
+ STRINGIFY_BIGINT ((records_read - records_skipped)
+ * record_size
+ - (prev_written + bytes_written), buf));
+ }
+ break;
+
+ case EXTRACT_SUBCOMMAND:
+ case LIST_SUBCOMMAND:
+ case DIFF_SUBCOMMAND:
+ print_stats (stderr, _("Total bytes read"),
+ records_read * record_size);
+ break;
+
+ default:
+ abort ();
+ }