Re: How to show system messages



Both of these methods use polling right, I don't think there's any way to be notified or block till there's new data or anything... you just have to keep testing the file for new data. And sleep() or usleep() some amount of time between checks so cpu usage don't go nuts.

you can popen ("tail -f filename", "r") and get tail to do the polling for you :) I'm pretty sure tail -f polls..

yeh enough rambling

On Sun, Jan 28, 2001 at 02:56:44PM -0700, Jeff Shipman wrote:
> You can:
> 
> 1) Check the timestamp of the file
> 
> 2) Use 'tail -f filename' and it will constantly
>    update whenever something is added.
> 
> Jeff "Shippy" Shipman     E-Mail: shippy nmt edu
> Computer Science Major    ICQ: 1786493
> New Mexico Institute of Mining and Technology
> Homepage: http://www.nmt.edu/~shippy
> 
> On Sun, 28 Jan 2001, Carlos Toledo wrote:
> 
> > Hello, i want to ask you more than a problem with gtk, a problem with C.
> > I want to do a messages console that shows the file /var/log/messages but
> > I have the problem that this file grows with all messages and when I have
> > read it, there is more information on this file. How can I do to know when
> > is new information whithout read the file all time or looking the size?
> >
> > Thanks for your help
> > (sorry for my horrible english)




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]