in reply to Re: getting values from child process
in thread getting values from child process

This node falls below the community's minimum standard of quality and will not be displayed.
  • Comment on Re^2: getting values from child process

Replies are listed 'Best First'.
Re^3: getting values from child process
by eyepopslikeamosquito (Archbishop) on Nov 10, 2010 at 11:51 UTC

    No file method wont work.
    Yes file method will work. :) The parent knows the pid of the child that just exited from the return value of wait. If each child writes the value of the PROJECTNAME "environment variable" just before it exits (you still haven't explained why it has to be an environment variable) to a file (pid.tmp, say), the parent can read the value of PROJECTNAME from the pid.tmp file.

    You still haven't explained the bigger picture, what is the type of problem you are trying to solve, and why running multiple sub processes is a good way to solve it. And do you really need environment variables? Or do you just need a decent IPC mechanism?

Re^3: getting values from child process
by Corion (Patriarch) on Nov 10, 2010 at 10:32 UTC

    When the child exits, the child environment is lost.