diff --git a/src/file.coffee b/src/file.coffee index f908e5cba..41c5af9f9 100644 --- a/src/file.coffee +++ b/src/file.coffee @@ -1,5 +1,4 @@ EventEmitter = require './event-emitter' -fs = require 'fs' path = require 'path' fsUtils = require './fs-utils' pathWatcher = require 'pathwatcher' @@ -23,9 +22,7 @@ class File # * symlink: # A Boolean indicating if the path is a symlink (default: false) constructor: (@path, @symlink=false) -> - try - if fs.statSync(@path).isDirectorySync() - throw new Error("#{@path} is a directory") + throw new Error("#{@path} is a directory") if fsUtils.isDirectorySync(@path) # Private: Sets the path for the file. setPath: (@path) ->