[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] wc: line-buffer the printed counts
From: |
Jim Meyering |
Subject: |
Re: [PATCH] wc: line-buffer the printed counts |
Date: |
Tue, 22 Dec 2009 10:38:56 +0100 |
Pádraig Brady wrote:
> wc is a essentially a digesting function like sha etc.
> in that it produces a 1 line summary per file.
> The attached patch ensures that those lines are output
> atomically for concurrent wc processes.
>
> Note in general one can use `stdbuf -oL cmd` to line-buffer
> a process which outputs to stdout, but I think this
> should be done internally in this case.
...
> + wc now prints counts atomically so that concurrent
> + processes will not intersperse their output.
> + [the bug dates back to the initial implementation]
Nice. Thanks!
You might want to cast this as an improvement, rather than a bug fix.
This made me think of doing the same for du, but I'm hesitant.
Many tools parse a single (voluminous) stream of du output,
and forcing that to be line-buffered sounds like it'd impose
too much of a penalty.