From 1dc325556ae629999539fd6ac447ff344207274a Mon Sep 17 00:00:00 2001 From: kwkofler Date: Tue, 11 Feb 2014 17:32:14 -0500 Subject: [PATCH] Resolves issue #112, though isBlockDevice(), isCharacterDevice(), isFIFO(), and isSocket() currently lack constants, hence return false. --- src/fs.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/fs.js b/src/fs.js index 1af666e..74a93c2 100644 --- a/src/fs.js +++ b/src/fs.js @@ -126,6 +126,34 @@ define(function(require) { this.mtime = fileNode.mtime; this.ctime = fileNode.ctime; this.type = fileNode.mode; + + function isFile() { + return (this.type === constants.MODE_FILE); + } + + function isDirectory() { + return (this.type === constants.MODE_DIRECTORY); + } + + function isBlockDevice() { + return false; + } + + function isCharacterDevice() { + return false; + } + + function isSymbolicLink() { + return (this.type === constants.MODE_SYMBOLIC_LINK); + } + + function isFIFO() { + return false; + } + + function isSocket() { + return false; + } } /*