in reply to Re: Temporary files and cleaning up after an interruption
in thread Temporary files and cleaning up after an interruption

Says tye:

How does a child wait for a parent to exit? (use flock as an IPC mechanism)

Another related technique:

# in the child: while (whatever...) { do_some_work(); if (getppid() == 1) { print "my parent is dead!"; clean_up(); exit; } }

Replies are listed 'Best First'.
(tye)Re2: Temporary files and cleaning up after an interruption
by tye (Sage) on Jan 05, 2001 at 10:23 UTC

    Yes, both of those work. I didn't use the first one because I already had a shared file handle so no need to create another one. I didn't use the second one because it doesn't allow me to wait; I have to loop sleeping and checking.

    But they are both good techniques to know. Thanks.

            - tye (but my friends call me "Tye")