Kolyan has asked for the wisdom of the Perl Monks concerning the following question:
Hello, dear monks!
I want to store net-acct's logs in the PostgreSQL database.
Program itself doesn't allow this, so I used File::Tail to consequentally read it's logfile.
But now I have another idea, e.g. to substitute program's logfile with fifo and read the data from it.
I tested it with the following (very simple) script:
#! /usr/bin/perl -w use strict; my $fifo = "/var/log/net-acct/net-acct.log"; while (1) { open(FIFO, "< $fifo") or die "Can't open fifo $fifo: $!\n"; while (<FIFO>) { print; } close(FIFO) or die "Can't close fifo $fifo: $!\n"; }
Everything seems to work just fine, so I want to ask you is there are things I should be aware of then working with named pipes?
Or even more generally is it a good idea at all?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: named pipe question
by jeffenstein (Hermit) on Apr 17, 2002 at 09:39 UTC | |
|
Re: named pipe question
by broquaint (Abbot) on Apr 17, 2002 at 09:45 UTC | |
|
Re: named pipe question
by mce (Curate) on Apr 17, 2002 at 09:46 UTC |