in reply to Re: Problem writing to file from a daemon
in thread Problem writing to file from a daemon

I solved the problem of when to close by trapping for close signals from the terminal (kill -1, kill -9) and including close handles in the event handler.

If you make something idiot-proof, eventually someone will make a better idiot.
I am that better idiot.