adrianlopezroche / fdupes

FDUPES is a program for identifying or deleting duplicate files residing within specified directories.
2.42k stars 186 forks source link

Write progress messages to the tty #48

Open sandrotosi opened 8 years ago

sandrotosi commented 8 years ago

From @sandrotosi on December 20, 2015 14:5

From matrixhasu on August 04, 2011 23:45:09

Hello, I'm forwarding the debian bug #625527, http://bugs.debian.org/625527 :

The progress messages ("Building file list" + twirling baton) are written to standard error. Thus, when logging the output of fdupes (fdupes >fdupes.log 2>&1), you either run with -q and have no progress reports or get progress noise in the log.

Progress messages should be written to the controlling terminal (/dev/tty). <<<

Regards, Sandro

Original issue: http://code.google.com/p/fdupes/issues/detail?id=19

Copied from original issue: sandrotosi/fdupes-issues#7

boldandbusted commented 6 years ago

The current behavior is nice only in that if I pipe to 'less' I see the progress meter update while the pipe waits for stdout. :)

ferdnyc commented 6 years ago

I... have what I guess may be a stupid question, though I realize the original reporter isn't part of this discussion: Why not only redirect stdout?

The entire reason for the progress meter being sent to stderr is so that you can run fdupes redirected with something like fdupes $FDUPES_ARGS >$FDUPES_LOG and not have the stderr noise end up in the $FDUPES_LOG file. (Same as with @boldandbusted 's pipe-to-less case.) Plus, if you're running interactively, you'll get to see any errors produced on the terminal immediately. Or even fdupes $FDUPES_ARGS| tee $FDUPES_LOG to see the list as well.

And if you're running non-interactively (such that you'd need all output, including errors, redirected to the log), then the progress meter really doesn't do much good anyway.