[fpc-pascal]linux ques

Michael Van Canneyt michael.vancanneyt at wisa.be
Thu Sep 23 10:27:09 CEST 2004

On Wed, 22 Sep 2004, Paul Aviles wrote:

> I have been task to write a routing for a web server running apache under
> linux that will basically have the same functionality as a tail -f
> /var/log/messages. I guess since the web server account does not have access
> to those files, there must be some type of listener/socket written to
> accomplish this. The goal is to be able to view log files in real time using
> a browser instead of a telnet or ssh session. Any ideas out there?

A unix socket should do it.
In the server, keep the last N lines in memory, keep scanning for more
lines. (use Poll or Select for this)
Client connects.
Client asks for M lines.
Server writes last M (<=N) lines.

This should be a simple modification of the client/server demo.
If you use the async event loop, it should be even easier.


More information about the fpc-pascal mailing list