Results 1 to 3 of 3

Thread: Standard error and standard output from QProcess in wrong order

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2008
    Posts
    155
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanked 15 Times in 13 Posts

    Default Re: Standard error and standard output from QProcess in wrong order

    That's what you see is probably indeed what the Ruby application produces. I have no idea how Ruby works, but for "usual" C programs stdout and stderr are typically not connected to each other, and stdout is typically buffered whereas stderr is not. So getting all stderr before the stdout buffer is flushed is not uncommon, also merging "packets" is not.

    So to get what you want to you need either to flush after each output operation or to (a) un-buffer stderr and (b) synchronize stderr and stdout, both in the Ruby application.

  2. #2
    Join Date
    May 2008
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Standard error and standard output from QProcess in wrong order

    Thanks for your answer. Since I'm writing a ruby editor, the ruby application will be written by the user, not by me, so I can't change it. At any rate, I tried executing my test ruby script from other editors (kdevelop, scite, netbeans) and they give the same output mine gives, so I guess there's nothing I can do about it.
    Stefano

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.