"Evan Klitzke" <[EMAIL PROTECTED]> writes:
> I checked the source code for tail and they actually poll the file by
> using fstat and sleep to check for changes in the file size. This
> didn't seem right so I thought about it more and realized I ought to
> be using inotify. So I guess I answered my
On Jun 22, 2:50 pm, "Kenji Noguchi" <[EMAIL PROTECTED]> wrote:
> something like this? unix tail command does more fancy stuff
> like it waits for timeout, and check if the file is truncated
> or depending on incoming data it sleeps seconds , etc etc.
>
> #!/usr/bin/env python
> import sys, select
>
On Jun 22, 12:50 pm, "Kenji Noguchi" <[EMAIL PROTECTED]> wrote:
> > I checked the source code for tail and they actually poll the file by
> > using fstat and sleep to check for changes in the file size. This
> > didn't seem right so I thought about it more and realized I ought to
> > be using inoti
On Fri, Jun 22, 2007 at 11:46:56AM -0700, Evan Klitzke wrote:
> I checked the source code for tail and they actually poll the file by
> using fstat and sleep to check for changes in the file size. This
> didn't seem right so I thought about it more and realized I ought to
> be using inotify. So I g
something like this? unix tail command does more fancy stuff
like it waits for timeout, and check if the file is truncated
or depending on incoming data it sleeps seconds , etc etc.
#!/usr/bin/env python
import sys, select
while True:
ins, outs, errs = select.select([sys.stdin],[],[])
for
On 6/22/07, Evan Klitzke <[EMAIL PROTECTED]> wrote:
> Everyone,
>
> I'm interested in writing a python program that reads from a log file
> and then executes actions based on the lines. I effectively want to
> write a loop that does something like this:
>
> while True:
> log_line = log_file.rea
Everyone,
I'm interested in writing a python program that reads from a log file
and then executes actions based on the lines. I effectively want to
write a loop that does something like this:
while True:
log_line = log_file.readline()
do_something(log_line)
Where the readline() method bl