 
            Hi all, I wanted to use hinotify, which gives notifications on file system changes, but found (quite naturally) that it wouldn't run on my windows machine (since it's a binding to the linux kernel). So I started writing a library that would give similar functionality on Windows. This is the first release of that, more a proof-of-concept than anything useful at this stage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Win32-notify-0.1 Still, feel free to test it, and I would love feedback on everything from desired API to suggestions on how to implement the low-level bindings more efficiently. Cheers, /Niklas
 
            Hi Niklas,
I'd love to see this functionality available cross-platform.  Are there
plans for a unified library with a single API?    Cheers, - Conal
On Sat, Apr 19, 2008 at 5:31 PM, Niklas Broberg 
Hi all,
I wanted to use hinotify, which gives notifications on file system changes, but found (quite naturally) that it wouldn't run on my windows machine (since it's a binding to the linux kernel). So I started writing a library that would give similar functionality on Windows. This is the first release of that, more a proof-of-concept than anything useful at this stage:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Win32-notify-0.1
Still, feel free to test it, and I would love feedback on everything from desired API to suggestions on how to implement the low-level bindings more efficiently.
Cheers,
/Niklas _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
 
            Conal Elliott:
I'd love to see this functionality available cross-platform. Are there plans for a unified library with a single API?
+1 It would be nice if the two inotify packages and this one could be combined. And if someone would add a kqueue backend for the BSD's and OSX then most platforms would be supported.
 
            I'd love to see this functionality available cross-platform. Are there plans for a unified library with a single API?
Yep, that's the plan (not too far) down the line, me and Lennart (who wrote the hinotify bindings) have already discussed it to some extent. I think the work order will be - get a decent API for Win32-notify up. - create a cross-platform single-API package on top of Win32-notify and hinotify. - go back to Win32-notify and make the implementation less naive. So API suggestions would be most welcome! Cheers, /Niklas
 
            Niklas Broberg wrote:
So API suggestions would be most welcome!
Your challenge will lie in finding an API that can be implemented efficiently on all concerned platforms. I don't know what the characteristics of the Windows or OS X notification APIs are, but if you use inotify on Linux, and you immediately issue a read every time select tells you there's something to be read, you'll easily consume 70% of a CPU when the filesystem gets busy. With a little guile, you can reduce that overhead by two orders of magnitude, to a fraction of a percent. It's not all that easy to do this well, but using inotify naively is so crippling that you must do it. Any higher-level API must account for factors like this.
 
            On Sun, Apr 20, 2008 at 5:22 PM, Bryan O'Sullivan 
Niklas Broberg wrote:
So API suggestions would be most welcome!
Your challenge will lie in finding an API that can be implemented efficiently on all concerned platforms. I don't know what the characteristics of the Windows or OS X notification APIs are, but if you use inotify on Linux, and you immediately issue a read every time select tells you there's something to be read, you'll easily consume 70% of a CPU when the filesystem gets busy.
With a little guile, you can reduce that overhead by two orders of magnitude, to a fraction of a percent. It's not all that easy to do this well, but using inotify naively is so crippling that you must do it. Any higher-level API must account for factors like this.
Factor has a file system notification API that wraps windows, linux and mac ones. It might be worth taking a look at that to see what it does.
participants (6)
- 
                 Bit Connor Bit Connor
- 
                 Bryan O'Sullivan Bryan O'Sullivan
- 
                 Conal Elliott Conal Elliott
- 
                 David MacIver David MacIver
- 
                 Felix Martini Felix Martini
- 
                 Niklas Broberg Niklas Broberg
