Re: *nix tail -f multiple log files with Thread

2009-02-13 Thread Jarkko Torppa
On 2009-02-13, Christian Heimes wrote: > David schrieb: >> Hi everyone, >> >> I copied a program from C to track multiple log files. I would like to >> be able to print a label when a log file is updated. Here is the program; > > Don't use threads for the job. On Unix the preferred way is select(

Re: *nix tail -f multiple log files with Thread

2009-02-13 Thread David
Joe Riopel wrote: On Fri, Feb 13, 2009 at 12:03 PM, David wrote: Hi everyone, I copied a program from C to track multiple log files. I would like to be able to print a label when a log file is updated. Here is the program; Since you're calling tail itself, why not just use tail's ability to

Re: *nix tail -f multiple log files with Thread

2009-02-13 Thread Joe Riopel
On Fri, Feb 13, 2009 at 12:03 PM, David wrote: > Hi everyone, > > I copied a program from C to track multiple log files. I would like to be > able to print a label when a log file is updated. Here is the program; Since you're calling tail itself, why not just use tail's ability to tail multiple f

Re: *nix tail -f multiple log files with Thread

2009-02-13 Thread Christian Heimes
David schrieb: > Hi everyone, > > I copied a program from C to track multiple log files. I would like to > be able to print a label when a log file is updated. Here is the program; Don't use threads for the job. On Unix the preferred way is select()'ing or poll()'ing multiple file descriptors. C

*nix tail -f multiple log files with Thread

2009-02-13 Thread David
Hi everyone, I copied a program from C to track multiple log files. I would like to be able to print a label when a log file is updated. Here is the program; #!/usr/bin/python from threading import Thread import subprocess from Queue import Queue num_threads = 3 queue = Queue() logfiles = ["