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.


Reply via email to