Re: [Haskell-cafe] inotify-alike for mac os x?

2009-12-04 Thread David Leimbach
d On Thu, Dec 3, 2009 at 7:55 PM, Gregory Collins g...@gregorycollins.netwrote: Conal Elliott co...@conal.net writes: I'd like to make some FRPish toys that keep files updated to have functional relationships with other files. hinotify looks like just the sort of underlying magic I

Re: [Haskell-cafe] inotify-alike for mac os x?

2009-12-04 Thread Ross Mellgren
kqueue is the low level interface, but requires that you handle all file system events as they happen, and fast. There is a higher level interface called fsevents (with accompanying daemon fseventsd) which allows you a more calm way to read the file system events.

Re: [Haskell-cafe] inotify-alike for mac os x?

2009-12-04 Thread Svein Ove Aas
On Fri, Dec 4, 2009 at 5:31 PM, Ross Mellgren rmm-hask...@z.odi.ac wrote: kqueue is the low level interface, but requires that you handle all file system events as they happen, and fast. For the purposes of creating a binding in haskell, my preferred way would be to use the low-level interface

Re: [Haskell-cafe] inotify-alike for mac os x?

2009-12-04 Thread Ross Mellgren
Well, I don't think anything bad will happen, but I think I remember there being no/little buffering, so your program had to be responsive if you wanted to get the events. fseventsd is a daemon on top that keeps logs, so you can read them at leisure. I'm sorry I can't find the original

Re: [Haskell-cafe] inotify-alike for mac os x?

2009-12-04 Thread Bryan O'Sullivan
On Fri, Dec 4, 2009 at 8:39 AM, Svein Ove Aas svein@aas.no wrote: That said.. you say you have to handle the events fast. What happens if you don't? If you don't handle events quickly, they're typically thrown away by the kernel without you ever getting to read them. That is, for

Re: [Haskell-cafe] inotify-alike for mac os x?

2009-12-04 Thread Ross Mellgren
On Dec 4, 2009, at 5:30 PM, Bryan O'Sullivan wrote: On Fri, Dec 4, 2009 at 8:39 AM, Svein Ove Aas svein@aas.no wrote: That said.. you say you have to handle the events fast. What happens if you don't? If you don't handle events quickly, they're typically thrown away by the kernel

Re: [Haskell-cafe] inotify-alike for mac os x?

2009-12-04 Thread Matt Morrow
Conal, If I were looking to do this, I'd read the relevant parts of the libev code. Matt On 12/3/09, Conal Elliott co...@conal.net wrote: I'd like to make some FRPish toys that keep files updated to have functional relationships with other files. hinotify looks like just the sort of

Re: [Haskell-cafe] inotify-alike for mac os x?

2009-12-04 Thread Conal Elliott
Thanks, Matt. I see libev is available via macports. - Conal On Fri, Dec 4, 2009 at 3:03 PM, Matt Morrow moonpa...@gmail.com wrote: Conal, If I were looking to do this, I'd read the relevant parts of the libev code. Matt On 12/3/09, Conal Elliott co...@conal.net wrote: I'd like to

Re: [Haskell-cafe] inotify-alike for mac os x?

2009-12-04 Thread Conal Elliott
Oh -- also libevent, described at http://www.monkey.org/~provos/libevent/ : Currently, *libevent* supports */dev/pollhttp://access1.sun.com/techarticles/devpoll.html *, *kqueue(2)http://www.freebsd.org/cgi/man.cgi?query=kqueueapropos=0sektion=0format=html *, *event

[Haskell-cafe] inotify-alike for mac os x?

2009-12-03 Thread Conal Elliott
I'd like to make some FRPish toys that keep files updated to have functional relationships with other files. hinotify looks like just the sort of underlying magic I could use for efficient implementation on linux. Is there any support for mac os x? Could support be either added to hinotify or

Re: [Haskell-cafe] inotify-alike for mac os x?

2009-12-03 Thread Gregory Collins
Conal Elliott co...@conal.net writes: I'd like to make some FRPish toys that keep files updated to have functional relationships with other files.  hinotify looks like just the sort of underlying magic I could use for efficient implementation on linux.  Is there any support for mac os x?