Accelerating Haskell Application Development

A Google Summer of Code 2012 Project

Initial Tests: hinotify or System.INotify

on May 19, 2012

I started playing around with the existing file watcher Haskell code cited in the project proposal today. Since I’m working on a Linux laptop I naturally started with the Linux hinotify package before moving to the Mac and Windows packages.

Here is what I’ve learned so far:

  • hinotify throws an exception if it’s asked to watch a file that doesn’t exist (blah!)
  • Created and Deleted events are reported as expected for directories and files, but hinotify is non-recursive so I’ll have to implement recursive directory tracking myself
  • Many events triggered by things such as listing a directory report Open and Close events without any path — i.e., maybeFilePath=Nothing; I think these events belong to the directory that I’m watching
  • Even though it was reported that vim does something weird with moving and/or overwriting files when it saves them hinotify doesn’t report anything unexpected; most importantly, it reports a Modified event on the file that is saved, though it only reports Created, Open, Close when a new file is created (i.e., saved for the first time)

The next task will be to get working Haskell environments on Mac and Windows machines so that I can do preliminary tests of those file watchers. Then I should be able to offer a unified recursive or non-recursive watcher that is attentive to some file pattern such as /.*[.][l]?hs[c]?/.

//Mark