tafa/node-watch-tree — pull request #8 by TrevorBurnham (2011-11-08 08:06:25+00:00)
Title: Node 0.6 compatibility

Anyone who uses node-watch-tree under Node 0.6 on a directory with files in it is going to get an error

Error: ENOTDIR, Not a directory 'dir/filename.ext'

It turns out the reason is—somewhat bafflingly—that the error code for `ENOTDIR` changed from 20 to 27, so the test `err.errno == ENOTDIR` in [stat.coffee[(https://github.com/tafa/node-watch-tree/blob/master/src/watchers/stat.coffee) fails. This patch changes the current `err.errno` checks to `err.code` checks.

Also, `require 'util'` is used instead of `require 'sys'` when running tests, since doing `require 'sys'` generates the distracting deprecation message

> The "sys" module is now called "util". It should have a similar interface.