开发者

Displaying realtime output from a text file on a webpage

I have a program running on one of my servers and the output is being redirected to a text file. I want to be able to watch the text file like a linux "tail -f output.txt"开发者_如何学JAVA would, but I want to watch it through a webpage.

Is this possible? How do it do it?

Thanks in advance!


From your linux reference I assume you use a linux/php stack?

Anyhow, you definitly need a server component (possibly a web service) that handles the file system watching and then expose the result through its web service interface. The webpage can poll that service periodically for updates on the content of that test file. Of course you have to use asynchronous calls (javascript ajax for example) from your web page to do the asynchronous polling.

There are many other elaborate solutions.. it would help if you specified you technology stack and parameters of what implementation you use.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜