Thread: Stream stdout to file

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    62

    Stream stdout to file

    Hi,

    I want my program to launch another program and read std out from it..this isn't a problem. However this other program never returns it just keeps on spewing out data. I'm wanting to capture this data and stream it to a file as it's received. Is this possible? I can't do this in a loop in my program because it needs to do other processing in parallel to this task.

    Any help much appreciated.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    So are you just going to keep asking, or are you going to post an attempt using popen() or some mix of fork/exec/dup calls to allow two processes to communicate?

  3. #3
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946
    Don't feel like writing a response, so you get year+ old threads. See my code example here. YMMV.
    http://cboard.cprogramming.com/showthread.php?t=57353
    hello, internet!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  3. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  4. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  5. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 10:46 AM