|
From: Soren A. <sor...@sp...> - 2002-03-22 10:09:59
|
On Wed, 20 Mar 2002 17:07:59 -0600 (CST), "M Joshua Ryan"
<jo...@um...> said:
> On Wed, 20 Mar 2002, Soren Andersen wrote:
> > > You may also want to look at freopen, which is part of the
> > > pleasures of working with ANSI.
> > Ahh? And should I take your mention of it as containing the implied
> > meaning that freopen() can help with the stdin problem? But it
> > looks like not, to me:
> > FILE *freopen(const char *filename, const char *mode, FILE *stream);
> > is the prototype for the function. To me it seems like the ability
> > to use a file descriptor argument instead of a path spec is a must
> > for this sort of thing.
> are you redirecting to/from a file? or trying to pipe 2 programs
> together? freopen allows you to do the first. eg.
> freopen("infile", "r", stdin); freopen("outfile", "w", stdout);
I am piping two programs together. In testing this on Win32, I found it
useful to start by working with redirection using the shell redirection
syntax '$ executable-name <filedata-ondisk' but in my shell scripts or
in the console this would hardly ever make sense to do. So the answer
is "piping". In the shell. Therefore i don't think that freopen() can
help me because i do not have control over what the "feeding-from"
application is doing (in source code); only over what the "feed-ee"
application does when invoked in this context (on the right hand side
of a pipe, in the shell).
Thanks!
Soren Andersen
|