Better "tail -f"

2002-04-02 Thread Bruno Figueira
Hi there, I have got the example of trailing a file from "Perl Cookbook": --- for (;;) { while () { print $_ } sleep 1; seek(FH, 0, 1); } --- However, if another program removes (all) lines from the file referenced by FH, perl looses the trailing (for a undetermined tim

Re: Better "tail -f"

2002-04-02 Thread jbajin
How about putting a file lock on it? That way if someone tries to access it and write to it, it will not work. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Better "tail -f"

2002-04-02 Thread Bruno Figueira
ril de 2002 12:24 To: Figueira, Bruno [CMPS:003R:EXCH] Cc: [EMAIL PROTECTED] Subject: Re: Better "tail -f" How about putting a file lock on it? That way if someone tries to access it and write to it, it will not work. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Better "tail -f"

2002-04-02 Thread Chas Owens
On Tue, 2002-04-02 at 09:23, [EMAIL PROTECTED] wrote: > How about putting a file lock on it? > > That way if someone tries to access it and write to it, it will not work. > One problem with doing this is that POSIX does not require programs to check to see if a file is locked before

RE: Better "tail -f"

2002-04-02 Thread Nikola Janceski
> > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Terça-feira, 2 de Abril de 2002 12:24 > To: Figueira, Bruno [CMPS:003R:EXCH] > Cc: [EMAIL PROTECTED] > Subject: Re: Better "tail -f" > > > How about putting a fil

Re: Better "tail -f"

2002-04-02 Thread drieux
On Tuesday, April 2, 2002, at 04:30 , Bruno Figueira wrote: > However, if another program removes (all) lines from the file referenced > by > FH, perl looses the trailing (for a undetermined time). How do I improve > this code to understand the file was changed? I misread your problem - then r

Re: Better "tail -f"

2002-04-02 Thread drieux
On Tuesday, April 2, 2002, at 07:04 , Nikola Janceski wrote: > open(TAIL, "tail -f $filename |") or die "no tail $! $?\n"; > while(){ print $_; > } > close TAIL; first off it doesn't seem to work - it is just siting there. The problem being that 'tail' is looking at the old inode

RE: Better "tail -f"

2002-04-02 Thread Nikola Janceski
user do it." ;) > -Original Message- > From: drieux [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 02, 2002 10:23 AM > To: [EMAIL PROTECTED] > Subject: Re: Better "tail -f" > > > > On Tuesday, April 2, 2002, at 07:04 , Nikola Janceski wrote: >

RE: Better "tail -f"

2002-04-02 Thread Bruno Figueira
D] Subject: Re: Better "tail -f" On Tuesday, April 2, 2002, at 04:30 , Bruno Figueira wrote: > However, if another program removes (all) lines from the file referenced > by > FH, perl looses the trailing (for a undetermined time). How do I improve > this code to understand