joyent/node — Issue #1869: fs.readdir() does not report ENOTDIR error on Windows
Author: jouz
Created: 2011-10-12 11:45:41+00:00
State: open

node.exe v0.5.9.

Using fs.readdir() with as parameter a path to a file does not produce the "ENOTDIR" error as expected. Instead an "UNKNOWN" error is reported.

Reproduce the error:
fs.readdir("path/to/a/file.txt", function(err, files) {
if (err) throw err;
}

This currently breaks the watch-tree module, specifically this file (line 148):
https://github.com/tafa/node-watch-tree/blob/master/lib/watchers/stat.js