[Interest] QProcess unbuffered
scott at towel42.com
Mon Mar 6 21:18:47 CET 2023
From: Björn Schäpers <qt-maillist at hazardy.de>
Sent: Monday, March 6, 2023 12:18 PM
To: Scott Bloom <scott at towel42.com>; interest at qt-project.org
Subject: Re: [Interest] QProcess unbuffered
Am 06.03.2023 um 02:11 schrieb Scott Bloom:
I have an external executable (mkvalidator from https://www.matroska.org/downloads/mkvalidator.html
It never flushes the output, and it uses linefeed without carriage returns to overwrite existing text on the output.
The problem is, when I run it via QProcess (on windows, Qt 5.15.10), I get zero output until the process ends. As if it was buffered, and the output was finally flushed
When running from the command line, I do get output continuously during the processing.
I setup a timer to waitForRead, didn’t do anything. I cant seem to force the QProcess to read all stdout or stderror info.
Interest mailing list
Interest at qt-project.org<mailto:Interest at qt-project.org>
I had the exact same problem (but without QProcess). You have to use a trick to disable the buffering, I don't know if its possible with QProcess, you will have to use QProcess::CreateProcessArgumentModifier or most likely CreateProcess directly.
If there is interest I can copy some of my data, but currently I can't access it.
I would love any info/data you can provide. Feel free to email me privately if you want.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest