in reply to Re: (WIN) Autoflush, Perl, Sleep and Powershell
in thread (WIN) Autoflush, Perl, Sleep and Powershell

> but I get the log getting written after sleep completes

yes sorry, I couldn't reproduce that part anymore.

But $|=1 aka autoflush should guaranty that it's written immediately, please try CTRL-c while sleeping and see if there is any output.

My interest is in reading the output of long running scripts in realtime.

FWIW I tried both quotes " and ' for the -E part.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re^2: (WIN) Autoflush, Perl, Sleep and Powershell

Replies are listed 'Best First'.
Re^3: (WIN) Autoflush, Perl, Sleep and Powershell
by karlgoethebier (Abbot) on May 17, 2021 at 16:48 UTC
    «My interest is in reading the output of long running scripts in realtime.»

    What about Get-Content with the flags -Tail and -Wait?

    «The Crux of the Biscuit is the Apostrophe»

      That's what I already do on the reading side.

      But my problem here is on the writing side.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery