| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Redirection |
Hello All,
Suppose I have a program which reads it's input from stdin, and sends it's
output to stdout. This program has to run permanently in the background on
a WWW-server. A CGI-script on the WWW-server should be able to send and
receive information to the permanent process (so the CGI-script should be
able to put information on stdin of the permanent process, and read
information from stdout of the permanent process).
I think the best way to do this is to create a `wrapper' around the
permanent program (in C), which keeps waiting for information from the
CGI-script, puts it on stdin of the `real' permanent program, reads stdout
from the permanent program, and sends this output back to the CGI-script.
The communication between the wrapper-program and the CGI-script isn't too
difficult (this can be done using any IPC-mechanism), but how do I write to
stdin of the permanent process, and read from stdout of that process?
I think there are 2 ways to determine when to stop reading. The first one
is to read until the permanent process starts waiting for input, the second
one is to examine the output to determine when the permanent process will
start waiting for input (the first option would be the best, but is it
possible?).
There is just one more thing which makes it even more difficult; no shells
are available on the WWW-server (because of security-reasons), so I
probably can't use popen() or something like that.
If possible, it should work both under OS/2 as Unix (Unix will be the
target platform, but if possible I want to develop and test it under OS/2).
I will use the emx-compiler to develop the application. Since the target
platform is Unix, I will appreciate every answer which works under Unix. It
would be nice however if I can also get it to work under OS/2.
If you know an answer which only works under Unix, not OS/2, then I think
you can better send it to me by netmail or email, since then it doesn't
have very much to do with OS/2 programming anymore.
I hope that what I want is possible, I'm looking forward to any information
about this. Thanks in advance.
Regards, Ruud (rsenden{at}cs.ruu.nl)
--- timEd/2 1.10+
* Origin: The OS/2 Warp Based System (2:280/804.2054)SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955 SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809 @PATH: 280/804 801 270/101 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™.