Redirecting standard input for external application

Discussion in 'C++' started by Gerrit Hulleman, Apr 29, 2004.

  1. Is it possible to redirect the standard input for an external application?

    Something like:
    ifstream in (...);
    std::streambufx oldbuf = cin.rdbuf(in.rdbuf());
    system(...);
    cin.rdbuf(oldbuf);

    The proces must run another program where the input for this external
    program is allready present in memory of the original proces.

    Gerrit
     
    Gerrit Hulleman, Apr 29, 2004
    #1
    1. Advertising

  2. "Gerrit Hulleman" <> wrote in message
    news:4090a8c6$0$557$4all.nl...
    > Is it possible to redirect the standard input for an external application?
    >
    > Something like:
    > ifstream in (...);
    > std::streambufx oldbuf = cin.rdbuf(in.rdbuf());
    > system(...);
    > cin.rdbuf(oldbuf);
    >
    > The proces must run another program where the input for this external
    > program is allready present in memory of the original proces.
    >
    > Gerrit
    >


    Not in standard C++, you certainly can do this on Unix and Windows but in
    both cases you need to use non-standard OS-specific API calls. Ask on a
    group dedicated to whatever operating system you are using.

    john
     
    John Harrison, Apr 29, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Z

    redirecting standard error

    Rob Z, Dec 2, 2004, in forum: C++
    Replies:
    3
    Views:
    973
    Alex Vinokur
    Dec 3, 2004
  2. Fuzzyman
    Replies:
    9
    Views:
    392
    Fuzzyman
    Jan 24, 2006
  3. Marteno Rodia
    Replies:
    1
    Views:
    313
    Marcin Rodzik
    Aug 4, 2009
  4. Astroboy
    Replies:
    3
    Views:
    607
    Astroboy
    Nov 9, 2009
  5. Joe
    Replies:
    0
    Views:
    117
Loading...

Share This Page