NO

Author Topic: Using a pipe  (Read 2739 times)

tpekar

  • Guest
Using a pipe
« on: May 15, 2014, 10:46:33 PM »
Does anyone have a simple example of using a pipe to communicate between a parent and child process?  Thanks!

Offline jj2007

  • Member
  • *
  • Posts: 536
Re: Using a pipe
« Reply #1 on: May 15, 2014, 11:48:40 PM »
In assembler, yes:

include \masm32\MasmBasic\MasmBasic.inc      ; download
  Init
  Inkey "Current time is ", Launch$("cmd.exe /C time /T")
  Exit
end start


Seriously: Pipes are a can of worms. For example, to avoid hanging apps, you need to read data in separate threads etc...

To get an idea (and some really good hits), google for SECURITY_ATTRIBUTES HANDLE_FLAG_INHERIT CreatePipe SetHandleInformation CreateProcess WaitForInputIdle CreateThread

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: Using a pipe
« Reply #2 on: May 16, 2014, 09:00:08 AM »
Could be a starting point...
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: Using a pipe
« Reply #3 on: May 16, 2014, 02:13:58 PM »
These are the standard native applications (from here).
« Last Edit: May 16, 2014, 02:16:05 PM by frankie »
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide