Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Redirecting standard input for external application

Reply
Thread Tools

Redirecting standard input for external application

 
 
Gerrit Hulleman
Guest
Posts: n/a
 
      04-29-2004
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


 
Reply With Quote
 
 
 
 
John Harrison
Guest
Posts: n/a
 
      04-29-2004

"Gerrit Hulleman" <(E-Mail Removed)> wrote in message
news:4090a8c6$0$557$(E-Mail Removed)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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to use Frames to create header for external site(Without it redirecting a parent) Astroboy HTML 3 11-09-2009 03:22 PM
external process and redirecting its streams Marteno Rodia Java 1 08-04-2009 02:16 PM
Redirecting Ruby on Rails Standard Output Joe Ruby 0 04-21-2006 09:44 PM
Redirecting standard out in a single namespace Fuzzyman Python 9 01-24-2006 11:40 AM
redirecting standard error Rob Z C++ 3 12-03-2004 09:32 AM



Advertisments