Skip to content

Instantly share code, notes, and snippets.

@NHQ
Created July 21, 2011 21:48
Show Gist options
  • Select an option

  • Save NHQ/1098304 to your computer and use it in GitHub Desktop.

Select an option

Save NHQ/1098304 to your computer and use it in GitHub Desktop.
fs.stat('public/person/'+rez.doc._id, function(err, stats){
console.log('stats: ' + JSON.stringify(stats)+'\n error: '+err);
if (err || !stats.isDirectory())
console.log(stats.isDirectory());
});
>> stats: {"dev":51712,"ino":434027,"mode":16804,"nlink":2,"uid":0,"gid":0,"rdev":0,"size":4096,"blksize":4096,"blocks":8,"atime":"2011-07-21T21:26:18.000Z","mtime":"2011-07-21T21:26:18.000Z","ctime":"2011-07-21T21:26:18.000Z"}
error: null
TypeError: Cannot call method 'isDirectory' of undefined
at /root/socio/server.js:302:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment