Tee and file redirections are very slow to write anything.

Eliot Moss moss@cs.umass.edu
Wed Feb 24 21:58:24 GMT 2021


On 2/24/2021 3:48 PM, ASSI wrote:
> Hamish McIntyre-Bhatty via Cygwin writes:
>> I found recently when trying to save output from a script for later
>> inspection that "tee" and file redirections seem to have massive
>> delays when run in Cygwin - usually nothing is written to file or
>> stdout until after the command has finished - not very helpful.
> 
> You will want to switch from fully buffered to line-buffered or even
> unbuffered output.

And this does not have to do with Cygwin.  The same happens on Linux.
The default is that terminal I/O is unbuffered while other stream are
buffered.  Pipes come under "other streams".  One can make programmatic
changes to get around this, but most programs won't override the
default behavior on their own ...

Best -- Eliot Moss


More information about the Cygwin mailing list