From: "Ardhan Madras" <ajhwb@knac.com>
To: Holger Kiehl <Holger.Kiehl@dwd.de>
Cc: ratheesh.ksz@gmail.com, linux-c-programming@vger.kernel.org
Subject: Re: File size events.
Date: Thu, 16 Sep 2010 20:29:00 -0700 [thread overview]
Message-ID: <20100916202900.DCECDBA@resin07.mta.everyone.net> (raw)
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
next reply other threads:[~2010-09-17 3:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-17 3:29 Ardhan Madras [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-09-13 14:11 File size events ratheesh k
2010-09-13 17:52 ` Holger Kiehl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100916202900.DCECDBA@resin07.mta.everyone.net \
--to=ajhwb@knac.com \
--cc=Holger.Kiehl@dwd.de \
--cc=linux-c-programming@vger.kernel.org \
--cc=ratheesh.ksz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).