wget logfile,如何设置单位为秒,千字节

wget logfile, how to set the unit to be seconds, and kilobytes

带 -nv 选项的 wget 日志文件的最后三行是

 FINISHED --2015-02-11 21:52:07--
 Total wall clock time: 4.8s
 Downloaded: 6 files, 316K in 1.7s (182 KB/s)

我想用 c 阅读这些行,所以我希望 316K 始终以 K 为单位,(我不想有 2.3M 等)我还希望时间始终以秒为单位(不是以秒为单位)分钟、小时等)。

PS 在 main.c(在 wget 源代码中)

             logprintf (LOG_NOTQUIET,
              _("FINISHED --%s--\nTotal wall clock time: %s\n"
               "Downloaded: %d files, %s in %s (%s)\n"),
             datetime_str (time (NULL)),
             wall_time,
             numurls,
             human_readable (total_downloaded_bytes, 10, 1),
             download_time,
             retr_rate (total_downloaded_bytes,      total_download_time));

如果你坚持要修改wget,把上面的改成

  logprintf (LOG_NOTQUIET,
             _("FINISHED --%s--\nTotal wall clock time: %s\n"
               "Downloaded: %d files, %ldK in %lds (%s)\n"),
             datetime_str (time (NULL)),
             wall_time,
             numurls,
             (long)(total_downloaded_bytes/1024),
             (long)total_download_time,
             retr_rate (total_downloaded_bytes, total_download_time));

- 但你应该重新考虑在你的 C 程序中处理几个单元。