trailing a growing file
Tue Dec 30 18:47:18 CET 2003
I am actually working on a multi-log multi-host monitoring (and
reacting) system, made in erlang and I need some advice:
I would like to read logs file as soon as data is written to them. I
actually have found 2 ways for this purpose:
- With Io module, pooling (each time I get an eof, I wait a small time
then try again).
- With ports, spawning "tail -f -n 1 /path/to/file", which is the method
I currently use.
Is there a other way to "receive" news lines as they are written in the
file without pooling or using an external application? I read few
messages saying that there was no blocking IO in erlang, but I think
this was mainly from a VM perspective. (I will have few hundreds logs to
I currently use the port solution and I sometimes have a "broken pipe"
error, I think this is because of the "in" parameter in open_port, but I
hat it sometime without this parameter, anybody have a more detailed
explanation of what could happen ?
Ps: the subject is directly taken from a point in the erlang PLEAC which
is still empty.
Avenue de l'Europe, Clapiers
34940 Montpellier Cedex 09
Tél : + 33 (0) 4 67 59 36 56
Fax : + 33 (0) 4 67 59 30 10
E-mail : raphael.bellec@REDACTED
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.556 / Virus Database: 348 - Release Date: 26/12/2003
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions