* Re: File size events.
@ 2010-09-17 3:29 Ardhan Madras
0 siblings, 0 replies; 3+ messages in thread
From: Ardhan Madras @ 2010-09-17 3:29 UTC (permalink / raw)
To: Holger Kiehl; +Cc: ratheesh.ksz, linux-c-programming
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@dwd.de wrote:
From: Holger Kiehl <Holger.Kiehl@dwd.de>
To: ratheesh k <ratheesh.ksz@gmail.com>
cc: linux-c-programming@vger.kernel.org
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@vger.kernel.org
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
^ permalink raw reply [flat|nested] 3+ messages in thread* File size events.
@ 2010-09-13 14:11 ratheesh k
2010-09-13 17:52 ` Holger Kiehl
0 siblings, 1 reply; 3+ messages in thread
From: ratheesh k @ 2010-09-13 14:11 UTC (permalink / raw)
To: linux-c-programming
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 ?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: File size events.
2010-09-13 14:11 ratheesh k
@ 2010-09-13 17:52 ` Holger Kiehl
0 siblings, 0 replies; 3+ messages in thread
From: Holger Kiehl @ 2010-09-13 17:52 UTC (permalink / raw)
To: ratheesh k; +Cc: linux-c-programming
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-09-17 3:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-17 3:29 File size events Ardhan Madras
-- strict thread matches above, loose matches on Subject: below --
2010-09-13 14:11 ratheesh k
2010-09-13 17:52 ` Holger Kiehl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).