   # Public: Returns a promise that resolves to the file's completely resolved {String} path.
   getRealPath: ->
     if @realPath?
-      Q(@realPath)
+      Promise.resolve(@realPath)
     else
-      Q.nfcall(fs.realpath, @path).then (realPath) =>
-        @realPath = realPath
+      new Promise (resolve, reject) =>
+        fs.realpath @path, (err, result) =>
+          if err?
+            reject(err)
+          else
+            resolve(@realPath = result)
 
   # Public: Return the {String} filename without any directory information.
   getBaseName: ->

  # Public: Returns a promise that resolves to a {Boolean}, true if the file
  # exists, false otherwise.
  exists: ->
    Q.Promise (resolve, reject) =>
      fs.exists @getPath(), resolve

  # Public: Returns a {Boolean}, true if the file exists, false otherwise.

            console.error newError

        try
          handleResolve = (newContents) =>
            unless oldContents is newContents
              @emit 'contents-changed' if Grim.includeDeprecatedAPIs
              @emitter.emit 'did-change'

          @read(true).then(handleResolve, handleReadError)
        catch error
          handleReadError(error)

