Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #56234

Re: How to streamingly read text file and display whenever updated text

References <04ee91f9-1cbf-4364-bca3-da25aa4db45f@googlegroups.com> <mailman.739.1380970927.18130.python-list@python.org> <f0461031-fd7c-42ff-b88b-c77cffcdce76@googlegroups.com>
Date 2013-10-06 14:28 +1100
Subject Re: How to streamingly read text file and display whenever updated text
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.768.1381031863.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Sun, Oct 6, 2013 at 2:17 PM,  <galeomaga@gmail.com> wrote:
> After tried many times, updated text file is not shown, it only print text at the first time.

The implementation of tail has a lot of little oddities to deal with
edge cases. Why not simply use it?

A while ago, I wanted to make a system that would tail a bunch of logs
on a bunch of computers, and display it all to me in a single unified
view. Rather than write something that opened a whole lot of files and
monitored them, I simply forked a 'tail' process for each file and
reacted to its stdout. It was way WAY easier than dealing with
everything that could possibly happen (log rotation, etc, etc, etc) -
not that it'd be impossible to deal with, but it's a waste of time
reinventing this particular wheel. Build on top of what's already
there, save yourself the trouble.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to streamingly read text file and display whenever updated text galeomaga@gmail.com - 2013-10-05 00:38 -0700
  Re: How to streamingly read text file and display whenever updated text galeomaga@gmail.com - 2013-10-05 00:54 -0700
    Re: How to streamingly read text file and display whenever updated text Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-05 09:12 +0100
  Re: How to streamingly read text file and display whenever updated text "James Harris" <james.harris.1@gmail.com> - 2013-10-05 09:06 +0100
    Re: How to streamingly read text file and display whenever updated text Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-05 09:14 +0100
  Re: How to streamingly read text file and display whenever updated text Nobody <nobody@nowhere.com> - 2013-10-05 11:25 +0100
  Re: How to streamingly read text file and display whenever updated text Joost Molenaar <j.j.molenaar@gmail.com> - 2013-10-05 13:02 +0200
    Re: How to streamingly read text file and display whenever updated text galeomaga@gmail.com - 2013-10-05 20:17 -0700
      Re: How to streamingly read text file and display whenever updated text Chris Angelico <rosuav@gmail.com> - 2013-10-06 14:28 +1100
      Re: How to streamingly read text file and display whenever updated text Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-06 04:06 +0000
        Re: How to streamingly read text file and display whenever updated text galeomaga@gmail.com - 2013-10-06 01:49 -0700
        Re: How to streamingly read text file and display whenever updated text Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-06 11:36 +0100
        Re: How to streamingly read text file and display whenever updated text Chris Angelico <rosuav@gmail.com> - 2013-10-06 22:03 +1100
        Re: How to streamingly read text file and display whenever updated text Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-06 12:13 +0100
        Re: How to streamingly read text file and display whenever updated text Chris Angelico <rosuav@gmail.com> - 2013-10-06 22:15 +1100
        Re: How to streamingly read text file and display whenever updated text Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-06 12:31 +0100
        Re: How to streamingly read text file and display whenever updated text Chris Angelico <rosuav@gmail.com> - 2013-10-06 22:44 +1100
          Re: How to streamingly read text file and display whenever updated text galeomaga@gmail.com - 2013-10-06 18:54 -0700
            Re: How to streamingly read text file and display whenever updated text Andreas Perstinger <andipersti@gmail.com> - 2013-10-07 11:52 +0200
  Re: How to streamingly read text file and display whenever updated text Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-05 12:08 +0100

csiph-web