Cool File & Directory Modules File::Tail 42 of 69 : prev | index | next

File::Tail

Additional

The module tries very hard NOT to "busy-wait" on a file that has little traffic. Any time it reads new data from the file, it counts the number of new lines, and divides that number by the time that passed since data were last written to the file before that. That is considered the average time before new data will be written. When there is no new data to read, File::Tail sleeps for that number of seconds. Thereafter, the waiting time is recomputed dynamicaly. Note that File::Tail never sleeps for more than the number of seconds set by maxinterval.

If the file does not get altered for a while, File::Tail gets suspicious and startschecking if the file was truncated, or moved and recreated. If anything like that had happened, File::Tail will quietly reopen the file, and continue reading. The only way to affect what happens on reopen is by setting the reset_tail parameter (see below). The effect of this is that the scripts need not be aware when the logfiles were rotated, they will just quietly work on.


© 2003 Barbie - barbie@missbarbell.co.uk contents http://birmingham.pm.org/