Redirecting standard input for external application

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gerrit Hulleman

    Redirecting standard input for external application

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

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

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

    Gerrit


  • John Harrison

    #2
    Re: Redirecting standard input for external application


    "Gerrit Hulleman" <hulleman@lup us-delta.tmfweb.nl > wrote in message
    news:4090a8c6$0 $557$e4fe514c@n ews.xs4all.nl.. .[color=blue]
    > Is it possible to redirect the standard input for an external application?
    >
    > Something like:
    > ifstream in (...);
    > std::streambufx oldbuf = cin.rdbuf(in.rd buf());
    > system(...);
    > cin.rdbuf(oldbu f);
    >
    > The proces must run another program where the input for this external
    > program is allready present in memory of the original proces.
    >
    > Gerrit
    >[/color]

    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


    Comment

    Working...