node-dir
Advanced tools
Comparing version 0.1.15 to 0.1.16
@@ -31,5 +31,10 @@ var fs = require('fs'), | ||
var getStatHandler = function(statPath) { | ||
var getStatHandler = function(statPath, lstatCalled) { | ||
return function(err, stat) { | ||
if (err) return callback(err); | ||
if (err) { | ||
if (!lstatCalled) { | ||
return fs.lstat(statPath, getStatHandler(statPath, true)); | ||
} | ||
return callback(err); | ||
} | ||
if (stat && stat.isDirectory() && stat.mode !== 17115) { | ||
@@ -67,3 +72,3 @@ if (type !== 'file') { | ||
fs.lstat(dir, function(err, stat) { | ||
fs.stat(dir, function(err, stat) { | ||
if (err) return callback(err); | ||
@@ -78,3 +83,3 @@ if(stat && stat.mode === 17115) return done(); | ||
file = path.join(dir, list[i]); | ||
fs.lstat(file, getStatHandler(file)); | ||
fs.stat(file, getStatHandler(file)); | ||
} | ||
@@ -81,0 +86,0 @@ }); |
{ | ||
"name": "node-dir", | ||
"version": "0.1.15", | ||
"version": "0.1.16", | ||
"description": "asynchronous file and directory operations for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index", |
22451
373