bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC] shred: --verbose output to stdout


From: Steven Schubiger
Subject: [RFC] shred: --verbose output to stdout
Date: Fri, 11 Jan 2008 20:15:34 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

After skimming through a bit of code from shred, I was eager
to see how easy it would be to change the corresponding calls
of error() that are relevant to verbosity output to call some
"equivalent" function, which outputs to stdout, i.e.

 static void
 output (const char const *fmt, ...)
 {
   va_list ap;
   va_start (ap, fmt);
   fprintf (stdout, "%s: ", program_name);
   vfprintf (stdout, fmt, ap);
   fprintf (stdout, "\n");
   va_end (ap);
 }

This is a bit more terse than it ought to be, but it illustrates
that it can be easily implemented for shred itself required that
3 non-fatal calls to error() are to be replaced with calls to output().

It is also questionable whether the code should reside in some library and
thus may also be used by mkdir and split or whether each program has its
own piece of customized code.

Steven Schubiger




reply via email to

[Prev in Thread] Current Thread [Next in Thread]