Re: File size events.
"Ardhan Madras" <[email protected]>
| Newsgroups | org.kernel.vger.linux-c-programming |
|---|---|
| Message-ID | <[email protected]> |
I think inotify kernel support will help if there is another app that watch for event and check the /tmp/rat.txt size each event occurred, additional synronization most likely needed between them. I guess you are talking about `log' like file on a limited disk space, You need to prevent the file's size get bigger than 20k maybe by make empty the file. I prefer the app that keep writing on that file also manage file size each write and do assigned work when file size hit it's limit.
Ardhan
--- [email protected] wrote:
From: Holger Kiehl <[email protected]>
To: ratheesh k <[email protected]>
cc: [email protected]
Subject: Re: File size events.
Date: Mon, 13 Sep 2010 17:52:35 +0000 (GMT)
On Mon, 13 Sep 2010, ratheesh k wrote:
> I have an application which keep on writing to one file /tmp/rat.txt.
> I would like to handle an event when the file size exceed 20kb . How
> to get this event ? Is there an event chain , i could register with ?
> is there any other easy mechanism ?
>
See inotify. This will not tell the size, just the event when someone
writes to the file. The size you can then get with stat() or fstat().
Holger
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
_____________________________________________________________
Listen to KNAC, Hit the Home page and Tune In Live! ---> http://www.knac.com