cxbast has asked for the wisdom of the Perl Monks concerning the following question:
The code I have does not wait. My assumption is that getting the parent of 1 means that I am getting a child without the overhead of the parent.
Code is Below
edit (broquaint): changed <pre> <code> tags# Fork the process as its own parent. I am assuming by # recieving a parent of 1 that the Child is not just a copy # of the parent. unless (fork) { # Create first child unless (fork) { # Create Second Child sleep 1 until getppid == 1; # Execute our command exec "distill mypsfile.ps"; exit 0; } exit 0; } # Wait for the first child to be reaped # How can we make this wait until the exec statement # has completed before exiting ????????? wait;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Creating Child without overhead of Parent
by broquaint (Abbot) on Jun 25, 2004 at 03:59 UTC | |
by jeffa (Bishop) on Jun 25, 2004 at 15:29 UTC | |
|
Re: Creating Child without overhead of Parent
by Crackers2 (Parson) on Jun 25, 2004 at 05:51 UTC | |
by jeffa (Bishop) on Jun 25, 2004 at 15:32 UTC | |
|
Re: Creating Child without overhead of Parent
by skyknight (Hermit) on Jun 25, 2004 at 13:43 UTC |