On Fri, Aug 16, 2002 at 03:41:50PM +0530, Rahul Kumar wrote:
> Unix question:

Programmer question, I think. Should go to LIP, I guess.

> I have a program that writes to a log file. Now, I would like a Perl
> script to append or modify the same log file once in a while. When i do
> so, the original program stops updating the log file. I guess it has
> lost the handle.
> 
> Is there any way for :
> a) my perl script to update the log without causing the other program to
> stop writing, OR

No.

> b) any way to reconnect the original program to the log file.

Yes. Setup a handler for SIGUSR1 in your original program, and ask perl
to deliver SIGUSR1 to your program once its through.

In the handler for the signal, reopen your log file. seek() into the file
to SEEK_END.

Binand

-- 
If you found this helpful, please take some time off to rate it:
http://svcs.affero.net/rm.php?r=binand


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to