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 --- Holger.Kiehl@xxxxxx wrote: From: Holger Kiehl <Holger.Kiehl@xxxxxx> To: ratheesh k <ratheesh.ksz@xxxxxxxxx> cc: linux-c-programming@xxxxxxxxxxxxxxx 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 majordomo@xxxxxxxxxxxxxxx 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 -- To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html