Results 1 to 7 of 7

Thread: Pipe multiple QProcess

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2007
    Location
    Italy
    Posts
    69
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    12
    Thanked 1 Time in 1 Post

    Default Pipe multiple QProcess

    Hello,
    I would like to pipe together multiple processes, so that one or more produces the data and the others read.

    I tried using QByteArray, as a buffer, but it's a bit tricky, because of the order in which processes starts and close. So I thought to use another QIODevice, like QBuffer, but I cannot find anything to feed a QIODevice as process stdin/out - but only setStandard(Input|Output|Error)File, which works with QStrings for actual paths.

    I am seeking for a simple mechanism, where a the output processes are given one output file as a buffer, and this file is passed as input to the others.

    What do you think is the best way to proceed?
    Thanks!

    EDIT:
    Also, consider I need to push some generated data to the input processes before they actually start.

    The tricky point is how to tell listening processes that input is finished, and therefore the input channel of receiving processes has to be closed correctly when ALL the producing processes (and my data source) have finished. I was thinking to something like a EOF sequence, but I do not think Qt works like that.
    Last edited by akiross; 29th April 2013 at 13:57. Reason: added ino

Similar Threads

  1. QProcess in main() opens multiple instances
    By gojkovicde in forum Newbie
    Replies: 2
    Last Post: 10th December 2012, 08:43
  2. Replies: 7
    Last Post: 13th September 2011, 14:15
  3. No process is on the other end of the pipe
    By Luc4 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 7th March 2010, 01:26
  4. pipe in a QByteArray to a QProcess
    By Gravis in forum Qt Programming
    Replies: 1
    Last Post: 28th February 2010, 23:53
  5. QProcess Bash in Event Filter (Multiple Processes)
    By Arsenic in forum Qt Programming
    Replies: 1
    Last Post: 8th November 2008, 09:42

Tags for this Thread

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.