Re: [PHP] read the last line in a file?

2009-05-17 Thread Per Jessen
Tom Worster wrote: 1) the inotify interface will alert you when a file or directory changes. do you mean the pecl inotify extension? Not specifically, but if that's how inotify is available in PHP, then yes. that would eliminate the polling and the associated lag. but the php manual

Re: [PHP] read the last line in a file?

2009-05-17 Thread Michael A. Peters
Tom Worster wrote: do you mean the pecl inotify extension? that would eliminate the polling and the associated lag. but the php manual says it requires linux. Yup - and it's kernel, so I don't think it could easily be ported to OS X. -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] read the last line in a file?

2009-05-16 Thread Per Jessen
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

Re: [PHP] read the last line in a file?

2009-05-16 Thread Tom Worster
On 5/16/09 3:55 AM, Per Jessen p...@computer.org wrote: 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,

[PHP] read the last line in a file?

2009-05-15 Thread Tom Worster
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,