Front page | perl.beginners |
Postings from April 2002
RE: Better "tail -f"
Thread Previous
|
Thread Next
From:
Nikola Janceski
Date:
April 2, 2002 07:31
Subject:
RE: Better "tail -f"
Message ID:
1449413DA482D311B67000508B5A12F50592DFC3@NYEXCHANGE01
preceed it with this then:
do{
sleep 1;
} while (not -e $filename);
of course... you want a more robust tail.. that will require lots of
thought... I don't have enough to spare for this though. I have thought
about this problem before and said, "screw it, let the user do it." ;)
> -----Original Message-----
> From: drieux [mailto:drieux@wetware.com]
> Sent: Tuesday, April 02, 2002 10:23 AM
> To: beginners@perl.org
> Subject: Re: Better "tail -f"
>
>
>
> On Tuesday, April 2, 2002, at 07:04 , Nikola Janceski wrote:
>
> > open(TAIL, "tail -f $filename |") or die "no tail $! $?\n";
> > while(<TAIL>){
> 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
> before the exterior process re-wrote the file
>
> try it at the command line
>
> in window a in window b
> tail -f file ./p2 > file
> ./p2 >file
>
> You need to go 're-seek' the file....
>
> ciao
> drieux
>
> ---
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
>
----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.
Thread Previous
|
Thread Next