On Fri, 18 Jul 2003, Marc-Antoine Ruel wrote:

> Sorry for my uncomprehension, but what do you exactly mean by piping?

In the Unix version, you can specify something like this:

    outputcommand=scs2ascii|enscript --output -|ps2pdf - -|lpr -Ppdf

In the code, there's a popen() call (open pipe) which accepts that string
as an argument.   Anything written to the FILE * that popen() returns will
be piped to the stdin or the scs2ascii command.   Likewise, the stdout
from scs2ascii is piped to stdin of enscript, etc, etc.

> If you means redirecting win32 text output to a deamon (another process
> and/or another computer), use a named pipe. It's quite simple to use.
> GetStdHandle/SetStdHandle does the job if you want to redirect text
> output. In C, we need to update a cached value (_stdout) but it's
> simple. Look for "Named Pipes" in MSDN

Well.. I sort of want to go to another process... really what I want is
the operating system to start up a process with the command line that I've
given, and send all of my output to that process's stdin, and then
likewise for the next program up the chain.

But, I'll take a look at that...

> It's always simpler to write than to code :)

Not in Unix...  this is much simpler than my explanation was:

      p = popen(outputcommand, "w");
      while (!tn5250_record_is_chain_end(This->rec))
           fprintf(p, "%c", tn5250_record_get_byte(This->rec));

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].