Jump to content

reading stdout...


Recommended Posts

here is the code from one of my programs (not complete of course)

;set all the env variables....
                ;GET
                EnvSet ('QUERY_STRING', $query)
                ;COOKIE - not yet implemented....
                EnvSet ('HTTP_COOKIE', '')
                EnvSet ('SERVER_SOFTWARE', 'Pangaea/'&$version)
                EnvSet ('SERVER_NAME', _GetIP())
                EnvSet ('GATEWAY_INTERFACE', 'CGI/1.1')
                
                EnvSet ('SERVER_PROTOCOL', 'HTTP/'&$http_version)
                EnvSet ('SERVER_PORT', $port)
                EnvSet ('REQUEST_METHOD', $method)
                EnvSet ('SCRIPT_NAME', $file)
                EnvSet ('REMOTE_ADDR', SocketToIP($iSocket))
                
                $pp_child = Run ($interp&' '&$params)
                StdinWrite ($pp_child, 'var=cool')
                StdinWrite ($pp_child)
                $out = StdoutRead ($pp_child)
that is obviously only a small section of the code, the whole script is much bigger.

$interp is:

C:\Program Files\AutoIt3\beta\AutoIt3.exe

$params is:

/ErrorStdOut /AutoIt3ExecuteScript "%f%"

(%f% is replaced with the script's path)

I know the script is being executed successfully, because if i put a message box in the script being run, the message box does successfully pop up. But, if the script does:

ConsoleWrite ("hello")

$out still just returns blank.

StdOutRead reads what the child ConsoleWrite's, correct? so why is $out still returning blank?

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

Probably wrong but worth a try

;set all the env variables....
                ;GET
                EnvSet ('QUERY_STRING', $query)
                ;COOKIE - not yet implemented....
                EnvSet ('HTTP_COOKIE', '')
                EnvSet ('SERVER_SOFTWARE', 'Pangaea/'&$version)
                EnvSet ('SERVER_NAME', _GetIP())
                EnvSet ('GATEWAY_INTERFACE', 'CGI/1.1')
                
                EnvSet ('SERVER_PROTOCOL', 'HTTP/'&$http_version)
                EnvSet ('SERVER_PORT', $port)
                EnvSet ('REQUEST_METHOD', $method)
                EnvSet ('SCRIPT_NAME', $file)
                EnvSet ('REMOTE_ADDR', SocketToIP($iSocket))
                
                $pp_child = Run ($interp&' '&$params,2) ; <-----
                StdinWrite ($pp_child, 'var=cool')
                StdinWrite ($pp_child)
                $out = StdoutRead ($pp_child)


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Probably wrong but worth a try

;set all the env variables....
                ;GET
                EnvSet ('QUERY_STRING', $query)
                ;COOKIE - not yet implemented....
                EnvSet ('HTTP_COOKIE', '')
                EnvSet ('SERVER_SOFTWARE', 'Pangaea/'&$version)
                EnvSet ('SERVER_NAME', _GetIP())
                EnvSet ('GATEWAY_INTERFACE', 'CGI/1.1')
                
                EnvSet ('SERVER_PROTOCOL', 'HTTP/'&$http_version)
                EnvSet ('SERVER_PORT', $port)
                EnvSet ('REQUEST_METHOD', $method)
                EnvSet ('SCRIPT_NAME', $file)
                EnvSet ('REMOTE_ADDR', SocketToIP($iSocket))
                
                $pp_child = Run ($interp&' '&$params,2) ; <-----
                StdinWrite ($pp_child, 'var=cool')
                StdinWrite ($pp_child)
                $out = StdoutRead ($pp_child)
I'm assuming you mean the "Provide a handle to the child's STDOUT stream" flag, which is the fourth parameter, not the second :P

i'll try that, thanks.

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...