[codeface] [PATCH 1/4] Extend output of R/ml/download.R

  • From: Claus Hunsen <hunsen@xxxxxxxxxxxxxxxxx>
  • To: codeface@xxxxxxxxxxxxx
  • Date: Fri, 1 Apr 2016 13:06:49 +0200

This patch makes sure that the output to stderr is also redirected to
the console when some error with nntp-pull occurs.
Additionally, the completion of the nntp-pull command is also logged to
the console.

Signed-off-by: Claus Hunsen <hunsen@xxxxxxxxxxxxxxxxx>
---
 codeface/R/ml/download.r | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/codeface/R/ml/download.r b/codeface/R/ml/download.r
index 6c59701..ddebecd 100755
--- a/codeface/R/ml/download.r
+++ b/codeface/R/ml/download.r
@@ -66,10 +66,11 @@ download.mbox <- function(ml, start.date, outfile) {
   ## TODO: Use nntp-pull --verbose, count the number of emitted
   ## lines, and provide a status progress bar.
   cmd <- str_c("nntp-pull --server=news.gmane.org --reget --limit=",
-               num, " '", ml, ">", outfile, "'")
+               num, " '", ml, ">", outfile, "' 2>&1")
   cat(str_c("Downloading ", num, " messages from ", ml, "\n"))
   cat(cmd, "\n")
   system(cmd)
+  cat("Download completed.\n")
 }
 
 #####################################################################
-- 
2.8.0


Other related posts:

  • » [codeface] [PATCH 1/4] Extend output of R/ml/download.R - Claus Hunsen