TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Rudy Oppers
from: Daniel Doran
date: 1995-03-29 00:14:00
subject: linking output to input?

RUDY OPPERS wrote something original about linking output to input?


RO> Does anyone know if it is possible to hook the input and output
RO> from one program to the output and input from an other program?  
RO> Maybe with a pipe or something like that? I am new to OS/2
RO> programming (MS-DOS and Amiga untill now :), so I don't know much
RO> about it...
RO> 
RO> I want to use the output from a text-based OS/2 program as input
RO> for a PM-oriented program and vice-versa....

Piping the output of one program into the input of another is easy:
type prog1|prog2 from the command line, and the output of prog1 will be
used as the input of prog2.  However, if you want to link them into a
ring, so that the output of prog2 will also be used as the input of
prog1, things get much more complicated.

If there isn't much data, and you aren't real concerned with speed, it
is possible to use two REXX scripts that communicate through a queue:
rexx1|prog1|prog2|rexx2, where rexx2.cmd passes everything input to it
through a named queue to rexx1.cmd  You could also write a pair of
C(++) programs to replace rexx1 and rexx2 that would use a queue, named
pipe or shared memory to do the same thing.

Note, however that piping only redirects standard input and output
(text only), not graphics or standard error messages.  In C this
corresponds to printf(), scanf(), gets(), puts() and other similar
functions.

 * KWQ/2 1.2g * Curiosity?  Nah, I got THAT cat with the lawnmower.

--- QScan v1.14b / 01-0093
* Origin: La Cantina BBS * El Paso * 915-532-0332 6GB, 3 Nodes (1:381/123)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 381/123 900 3615/50 396/1 270/101 105/103 42 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.