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

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to