Following a file, or cloning tail
Boudewijn Rempt
boud at rempt.xs4all.nl
Thu Jun 29 15:16:33 EDT 2000
On Wed, 28 Jun 2000, Darrell Gallion wrote:
> If your on Windows and can wait for the file to complete writing, check out
> http://www.dorb.com/darrell/win32WorkSvr/
>
I have to be portable, worse luck!
> The best solution might be to use popen if you can.
You mean simply a os.popen("tail -f myfile","r").readline() should
work? It sounds to easy to be true ;-)
>
> Trail might be a problem if the other application doesn't flush() the file
> once in a while.
It calls flush() allright, that's not the problem.
> 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.
>
Thanks for all the pointers!
Boudewijn Rempt | http://www.valdyas.org
More information about the Python-list
mailing list