From 7765fd06a89c0eadcd4225e482f178139ff2e24c Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Wed, 14 Sep 2011 11:41:04 -0700 Subject: [PATCH] Added exists --- src/fs.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fs.coffee b/src/fs.coffee index 17d8bb3af..1a0242e7f 100644 --- a/src/fs.coffee +++ b/src/fs.coffee @@ -20,6 +20,11 @@ module.exports = changeWorkingDirectory: (path) -> OSX.NSFileManager.defaultManager.changeCurrentDirectoryPath path + # Returns true if the file specified by path exists + exists: (path) -> + exists = OSX.NSFileManager.defaultManager. + fileExistsAtPath_isDirectory path, null + # Returns true if the file specified by path exists and is a # directory. isDirectory: (path) -> @@ -70,4 +75,4 @@ module.exports = # Return the path name of the current working directory. workingDirectory: -> - OSX.NSFileManager.defaultManager.currentDirectoryPath.toString() \ No newline at end of file + OSX.NSFileManager.defaultManager.currentDirectoryPath.toString()