[Gambas-user] EXEC ... WAIT FOR READ
Rob
sourceforge-raindog2 at ...94...
Mon Jul 28 20:17:11 CEST 2003
I've started working on a CGI module for Gambas (not all that seriously, but I
would like to get into a discussion about "Gambas Server Pages" eventually :)
), and the first thing I need to do is spawn a shell and run "set" so I can
get a list of environment variables. But running
EXEC [ "bash", "-c", "set" ] WAIT FOR READ AS BashProcess
while it sparks the process, never causes Process_Write to be called.
Removing the WAIT works, but I don't always get a complete set of variables
(sometimes it cuts off after 2 or 3, sometimes it goes all the way.) Adding
the lines
Do While BashProcess.State = Process.Running
Wait
Loop
in the calling sub has the exact same effect as adding the WAIT to the EXEC
line, i.e. no output at all.
The best results I've had have been without the WAIT but adding "; sleep 2" to
the third EXEC array element. However, while I always seem to get complete
output that way, it's no longer broken into lines for some reason, but comes
down in (I would bet) 256 byte chunks which I need to append together and
then split on \n to get my array of variables. So then I'm back to needing
to wait till the process has ended again in order to parse the variables out,
and I don't have a good way to do that.
Suggestions?
Also, is there a way to WATCH standard input the way you can add WATCH when
opening device files now? Because POST forms provide their form variables on
the standard input, and other stuff (like cookies) is the same way.
Rob
More information about the User
mailing list