in reply to how to join these interdependent codes???

Parent:

  1. Create named pipe
  2. Spawn asynchronous child, passing name of the pipe as a parameter.
  3. Write to pipe.
  4. Close the pipe.
  5. Reap child.

Child:

  1. Open the file provided as argument.
  2. Read from the file handle until eof.

But it's very odd to use a *named* pipe if you're writing both programs. Anonymous pipes would suffice.

  • Comment on Re: how to join these interdependent codes???

Replies are listed 'Best First'.
Re^2: how to join these interdependent codes???
by perlprint (Initiate) on Aug 24, 2009 at 08:33 UTC
    hey after i create a named pipe ..i need to give connect().but i cant have the code to write to pipe just next to connect(). so it should be like creating named pipe and waiting for connecting.while waiting for connecting..i should invoke a method to write on pipe..

      hey after i create a named pipe ..i need to give connect().

      Do that after spawning the child.

      while waiting for connecting..i should invoke a method to write on pipe..

      No, write after you're connected.