Re: read the last line in a file?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tom Worster wrote:
imagine writing a script to run as a daemon reading data off the bottom of a
log file that gets updated every few minutes and processing each new log
line as they arrive.

i could exec("tail $logfile", $lines, $status) every now and then. or poll
the file mtime and run exec("tail $logfile", $lines, $status) when it
changes. there will be some lag due to the polling interval.

but it would be nice to not have to poll the file and somehow trigger the
processing of the new line when the log file is written. but i'm not sure
how to do that.

any ideas?



possibly the vaguest answer ever..
http://php.net/posix_mkfifo
FIFOs

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux