Tailing a log file?
Stephen R Laniel
steve at laniels.org
Fri Jun 22 14:53:48 EDT 2007
On Fri, Jun 22, 2007 at 11:46:56AM -0700, Evan Klitzke wrote:
> I checked the source code for tail and they actually poll the file by
> using fstat and sleep to check for changes in the file size. This
> didn't seem right so I thought about it more and realized I ought to
> be using inotify. So I guess I answered my own question.
I've not thought about it much, but how about using Twisted?
Something like the LineReceiver class seems appropriate
here.
http://twistedmatrix.com/documents/current/api/twisted.protocols.basic.LineReceiver.html
--
Stephen R. Laniel
steve at laniels.org
Cell: +(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key
More information about the Python-list
mailing list