[Interest] QProcess unbuffered

Thiago Macieira thiago.macieira at intel.com
Mon Mar 6 06:25:28 CET 2023

On Sunday, 5 March 2023 20:32:20 PST Bob Babcock wrote:
> I haven't tested this, but what happens if you use QProcess to run
>    cmd /c mkvalidator ...
> I suggest this because mkvalidator output isn't buffered when run in a .bat
> file. You might lose return codes doing it this way.

If you were saying "/bin/sh" "-c" "mkvalidator" on a Unix system, I'd say it 
makes absolutely no difference. The issue is whether stdout is connected to a 
terminal or not, and using a shell doesn't change that.

On Windows, I have no clue. The equivalent concept of a terminal is a console, 
but the lack of a standard C library makes the question more difficult than it 
would otherwise appear. Is mkvalidator a /subsystem:console application or is 
it GUI? If it is GUI, how does it determine whether to write anything to 
stdout at all? If it's console, how does it choose between line-buffered and 
fully-buffered? And how does this all change if you use cmd.exe?

Sorry, I don't know the answer.

If at all possible, I'd investigate if this application has a separate, 
machine-communication channel that you can use instead of the stdout pipe.

Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5152 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20230305/5b7a0016/attachment.bin>

More information about the Interest mailing list