All right, this post is just to stop somebody else’s suffering in figuring out why writing to stdin in QProcess on Version 3.3.x-8 of Q…/Free doesn’t work on Windows. Well, actually it works but just for the first line you write to stdin. There is a bug in qprocess.cpp at line 730:
void QProcess::writeToStdin( const QString& buf )
{
QByteArray tmp = buf.local8Bit();
tmp.resize( tmp.size() - 1 ); // drop the implicit \0
writeToStdin( tmp );
}
should be:
void QProcess::writeToStdin( const QString& buf )
{
QByteArray tmp = buf.local8Bit();
tmp.resize( buf.length() );
writeToStdin( tmp );
}
Verision 3.3.7-7 includes the latter method, same as the latest Qt 4.3 sources. So, it’s actually a regression in 3.3.x-8. If you require the latest Qt 3 / Q…/Free for your open source application and need to write to some other processes’ stdin, you can just use a wrapper workaround that uses the latter method and directly uses writeToStdin( const QByteArray& buf ) instead of the QString variant.



Comments
David, duplicity broken pipe, Mike, maximus, Mark, Mike
Ted, Ted, Emmanuel, Meme, Lara Boons, stwoods, NeoBetas, Dalain, Axely, sofiaa [...]
matthis, Andre, matthis, Andre, JB, slewis69au, sofaraway2us2, JavaHack, AGAWA Koji(atty), wirelessdreamer [...]
Keith Wedinger, Gregory Robinson, Carl Carter-Schwendler
Luís Miranda, Mico, Sriram M, Andrew Ferguson, Carl Stephenson, Todd, chencho, Morgan, Ryan, Ryan [...]
Meme