in reply to Reading log files that get overwritten

Is this a text file, or a binary one (e.g. $FWDIR/log/fw.log is a binary file). Is it being written by the system or by FireWall-1, or by a script you wrote? I only ask because FireWall-1 has a command-line interface to its binary log format that may do what you want, and is scriptable.

If possible, the best way to deal with files like this is to not even bother reading them - but by sending the data from the generating process in realtime over a network socket, much as remote syslog does. That way, you don't have to worry about the file contents.

If the above is not an option, you could try File::Tail. Nokia's "unsupported" perl package installs in /opt, which *is* mounted read/write (unlike the root partition) so you should be able to make it work by installing it in one of the @INC directories, which are all under /opt/perl/lib/perl5.

Doug
  • Comment on Re: Reading log files that get overwritten

Replies are listed 'Best First'.
Re: Re: Reading log files that get overwritten
by Zapawork (Scribe) on Jan 03, 2003 at 06:59 UTC
    Hi Doug,
    As I noted in a later reply, the command line utility is the source of my problem. It reads to EOF and then stops. So my solution is to read fw.log directly and then interpret the data on the remote end. So I am going to try the file::tail solution that was brought up earlier.

    Thanks for the help!
    Dave -- Saving the world one node at a time