Following a file, or cloning tail

Darrell Gallion darrell at dorb.com
Wed Jun 28 21:43:42 EDT 2000


If your on Windows and can wait for the file to complete writing, check out
http://www.dorb.com/darrell/win32WorkSvr/

The best solution might be to use popen if you can.

Trail might be a problem if the other application doesn't flush() the file
once in a while.
If it does you should be able to just call read() on an interval or use
select to avoid polling.
Select won't help you on Windows though, but Win32 calls will.

--Darrell Gallion


----- Original Message -----
From: "Boudewijn Rempt" <boud at rempt.xs4all.nl>
Newsgroups: comp.lang.python
To: <python-list at python.org>
Sent: Wednesday, June 28, 2000 12:19 PM
Subject: Following a file, or cloning tail


> I'm trying to write an application that follows the output of another
> app, analyzes it, and serves it up as html. Kind of filtering tail,
> really. Is there any accepted 'best' way of 'tailing' a file?
>
> I thought about having two threads, one doing the tailing, one
> doing the servering (instantiating new threads as needed), but I
> can't even get the tailing right!
>
> --
>
> Boudewijn Rempt  | http://www.valdyas.org
> --
> http://www.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list