Zbigniew Zag�rski wrote:

> I have a question about unix I/O system.
> Can i create a "virtual" file which works like i'want
> and is represented as file descriptor. I mean that 
> i call write(fd,...) and the kernel instead read from pie,file 
> or socket is calling user defined function ?
> I want do use it for redirection of stdin/out for
> grahics console (like quake). I want to do it so to
> program will call read /write to/from stdin/out like 
> in text mode, and the result will be on screen or from screen!

The most straightforward way to do this is to redirect stdin/stdout to
a socket, a pty or a pair of pipes before the program is run, and have
a program at the other end.

For programs which expect stdin/stdout to be a terminal device, you
need to use a pty. Look at the source code for the `script' program
for details.

-- 
Glynn Clements <[EMAIL PROTECTED]>

Reply via email to