[Gambas-user] Sending special characters to a process

Benoit Minisini gambas at ...1...
Fri Aug 13 20:11:08 CEST 2004


On Friday 13 August 2004 19:36, Daniel wrote:
> > PRINT #hProc, Chr$(4)
> >
> > does not work ?
>
> No, It does not work :-( I send you the sources, it needs "Ploticus",
> which is a nice program to draw graphs. ( http://ploticus.sf.net )

Mmm... It smells like a good component :-)

Well, hitting CTRL+D is a special terminal command that seems to close the 
process input, or at least force the read() executed in the process to return 
zero or EOF.

As a workaround, I modified the stream that manage processes i/o so that 
calling CLOSE on the process will close the interpreter pipe that send data 
to the process input, which seems to have the same behaviour as hitting 
CTRL+D.

It is not a very clean solution, as the pipe that read from the process output 
is not closed. But maybe there is no need to close it.

The true solution would be writing a component that properly manages Linux 
virtual terminals so that we can easily put a terminal between process i/o 
and interpreter i/o.

Anyway, you can put your data in a temporary file, and use:

SHELL "pl ... < MyData.tmp"

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list