caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: Orlin Grigorov <ogrigorov@gmail.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] How to monitor a specific file for changes
Date: Wed, 24 Oct 2007 13:53:26 +0100	[thread overview]
Message-ID: <20071024125325.GA12110@furbychan.cocan.org> (raw)
In-Reply-To: <b17e12b30710221203o17cb0bc0sfba89354cd5cd809@mail.gmail.com>

On Mon, Oct 22, 2007 at 03:03:35PM -0400, Orlin Grigorov wrote:
> This time I've done my research, but still I cannot find a good answer.
> Basically, I need to make a little ocaml process, which runs in the
> background and monitors a specific file for changes.   When a change occurs,
> I want it to back-up a copy of the version of the file at that moment.
> So, what I need is to set some signal or event, which will happen every time
> that file is changed.
> 
> Can you guys help me do it?

As well as the others mentioned, there is also Gamin which is a GNOME
API designed for this.  Originally there was a thing called FAM which
SGI invented, however it required a system-wide daemon.  Gamin is
FAM-compatible at the API level and uses the appropriate kernel calls
for the current operating system.

  http://www.gnome.org/~veillard/gamin/
  http://www.gnome.org/~veillard/gamin/differences.html

Although if current operating system != Linux, then YMMV.  Apparently
there are backends for Mac OS X, BSD & Solaris.

Gamin has an OCaml binding:

  http://svn.metaprl.org/viewvc/mojave/omake/src/clib/omake_notify.c?view=log&pathrev=1326

(well, really it's a FAM binding, but the APIs are supposed to be
compatible).

None of this works over NFS unfortunately.

Rich.

-- 
Richard Jones
Red Hat


      parent reply	other threads:[~2007-10-24 12:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-22 19:03 Orlin Grigorov
2007-10-22 19:05 ` [Caml-list] " Robert Fischer
2007-10-22 19:09 ` Sylvain Le Gall
2007-10-22 19:11 ` [Caml-list] " Andrew Gacek
2007-10-22 19:20 ` Erik de Castro Lopo
2007-10-22 19:30   ` Orlin Grigorov
2007-10-22 19:38     ` Erik de Castro Lopo
2007-10-22 19:39     ` Jake Donham
2007-10-22 19:44       ` Orlin Grigorov
2007-10-22 19:42     ` Karl Zilles
2007-10-22 19:57       ` Orlin Grigorov
2007-10-23  7:50         ` Dave Benjamin
2007-10-23 17:17           ` Orlin Grigorov
2007-10-24 12:54       ` Richard Jones
2007-10-24 18:14         ` Karl Zilles
2007-10-24 21:56           ` Sylvain Le Gall
2007-10-22 19:43     ` Re : [Caml-list] " Adrien
2007-10-22 19:59 ` Gordon Henriksen
2007-10-24 12:53 ` Richard Jones [this message]

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=20071024125325.GA12110@furbychan.cocan.org \
    --to=rich@annexia.org \
    --cc=caml-list@yquem.inria.fr \
    --cc=ogrigorov@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).