You haven't missed anything, well, it's more like "tail --follow=name ' but instead of piping the output of tail into another program for processing, this just does all the work in python. Not only was it fun to write, but I like the fact that I don't need to chain more programs together. --Mike On Fri, Sep 21, 2012 at 9:29 AM, Lorenzo Beretta wrote: > On 21/09/2012 04:25, Mike Buland wrote: > >> I took a different approach and monitored the log output of svlogd, since >> I >> wanted the logs anyway. This is some code that well help you with that, >> anyway: >> >> import os >> import time >> import stat >> >> fIn = open("current", "r") >> sid = os.stat("current")[stat.ST_**INO] >> >> while True: >> try: >> sidNew = os.stat("current")[stat.ST_**INO] >> if sidNew != sid: >> fIn.close() >> fIn = open("current", "r") >> sid = sidNew >> except: >> time.sleep( 1 ) >> continue >> >> while True: >> l = fIn.readline() >> if l is None or l == '': >> break >> # do something interesting with your line here >> time.sleep( 1 ) >> >> This will read everything from current, and when current moves, it will >> read what's left, open the new current, and read all of it. I use it to >> monitor apache log output, and it hasn't failed me yet. >> >> --Mike >> > > Unless I missed something, it looks as if you're reimplementing the '-F' > flag in tail :) > > >