Add node.type test for read_directory_data - causes new test failures

This commit is contained in:
David Humphrey (:humph) david.humphrey@senecacollege.ca 2014-07-16 15:40:40 -04:00
parent 2992f7417b
commit 4623b568fb
1 changed files with 2 additions and 0 deletions

View File

@ -607,6 +607,8 @@ function open_file(context, path, flags, callback) {
function read_directory_data(error, result) { function read_directory_data(error, result) {
if(error) { if(error) {
callback(error); callback(error);
} else if(result.type !== MODE_DIRECTORY) {
callback(new Errors.ENOENT());
} else { } else {
directoryNode = result; directoryNode = result;
context.get(directoryNode.data, check_if_file_exists); context.get(directoryNode.data, check_if_file_exists);