docs: function resolvePath(path, options, callback) {
          if (!callback) {
              callback = options;
              options = {};
          }
          
          var alreadyRooted = options.alreadyRooted;
          var checkSymlinks = options.checkSymlinks === undefined 
              ? true : options.checkSymlinks;
          var isHome        = false;
          
          if (checkSymlinks === undefined)
              checkSymlinks = true;
          if (path.substr(0, 2) == "~/") {
              isHome = true;
              path = process.env.HOME + path.substr(1);
          }
          else if (!alreadyRooted) 
              path = join(root, path);
  
          if (checkSymlinks && fsOptions.checkSymlinks && !alreadyRooted) 
              fs.realpath(path, check);
          else check(null, path);
  
          function check(err, path) {
              if (err) return callback(err);
              
              if (!options.nocheck) {
                  if (!(path === base || path.substr(0, root.length) === root)
                    && !isHome) {
                      err = new Error("EACCESS: '" + path + "' not in '" + root + "'");
                      err.code = "EACCESS";
                      return callback(err);
                  }
              }
              callback(null, path);
          }
      }