Hi all,
I need to stream a text log file via web2py. The file is generated by a python script that runs outside web2py, but is saved to the "uploads" folder.
This is what I have in a controller called 2.py:
def index():
import os
path=os.path.join(request.folder,'uploads','log.log')
return response.stream(open(path,'rb'),chunk_size=4096)
When I navigate to ...app/2 the contents of log.log are displayed on the browser, yes. But my problem is that I only need to see the tail of the file (it can get very large), like you would from the command line.
tail -f log.log
Any ideas?
Thanks!
Vin