Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

IPC via stdinwrite() and consoleread()

$
0
0

Hello I am attempting some IPC between two scripts, I have been able to get it to work this way in the past, but it's been a long while since I've coded that script.

Below is what I have so far, what it should do is write the current number to the stdin stream of the child process, and the child process should write to a file any data it receives.

 

However it seems the child process is not getting the messages.

AutoIt         
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** if not @Compiled then Exit If $cmdlineraw = "/IPC" Then     $buffer = ""     While 1         Sleep(10)         _checkstdin()     WEnd EndIf $IPC = run(@ScriptFullPath&" /IPC", @ScriptDir, @SW_HIDE) $i = 0 while 1     StdinWrite($IPC, $i)     ConsoleWrite($I&@CRLF)     $i += 1     sleep(10) WEnd func _checkstdin() ;subprocess gets commands and sends to main $buffer &= ConsoleRead() if $buffer <> "" Then FileWrite(@ScriptDir&'\log.txt', $buffer&@CRLF) EndIf $buffer = "" EndFunc

(this must be compiled to work, obviously)

 


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>