[Logcheck-devel] logtail ignoring information in rotated logs

Joel Williams joel+logcheck at tristesse.org
Thu Nov 11 04:52:13 UTC 2004


> > if ((undef,$rotatedino,undef,undef,undef,undef,undef,$rotsize) = stat "$logfile.0") {
> i always wondered how such aline can be considered to be sane.
> is perl stat() so difficult to access?

Well, you could get rid of these lines. I just copied what was already
there :) Size could be calculated using:

if (! -f $logfile) {
  ..
}

$size = -s _;

Unfortunately there's no short-cut operator for determining the inode,
as far as I can see.

(undef, $ino) = stat($logfile); would work though, because we already
know the size at that point. It also has the classy bonus of not
scrolling beyond the end of the screen.

Cheers,
Joel




More information about the Logcheck-devel mailing list