onhashchange fix for IE<8

@param {Function} fn
@param {String} path
@api private
190343
function fix(fn, path) {
  if (!running) return;

  if (path !== location.hash) {
    fn();
    path = location.hash;
  }

  setTimeout(function() {
    fix(fn, path);
  }, 500);
}
1254225
function checkPath(string, callback, done) {
    var path = string;
    if (!(/^\.|\//).test(string)) {
        path = './' + string;
    }

    fs.stat(path, function(err) {
        if (err) {
            console.log(chalk.red('Error, cannot open: %s'), string);
            process.exit(1);
        } else {
            callback(path, done);
        }
    });
}
48271
function read(path, options, fn) {
  var str = readCache[path]

  // cached (only if cached is a string and not a compiled template function)
  if (options.cache && str && typeof str === 'string') return fn(null, str)

  // read
  fs.readFile(path, 'utf8', function(err, str) {
    if (err) return fn(err)
    if (options.cache) readCache[path] = str
    fn(null, str)
  })
}
184253
function(path) {

		// If the path is empty
		if (!path) {
			return window.location;
		}

		// Chrome and FireFox support new URL() to extract URL objects
		else if (window.URL && URL instanceof Function && URL.length !== 0) {
			return new URL(path, window.location);
		}

		// Ugly shim, it works!
		else {
			var a = document.createElement('a');
			a.href = path;
			return a.cloneNode(false);
		}
	}
343501
function(file, fn) {

    NX.Path.exists(file, function(exists) {

        if(!exists) {
            fn();
        } else {
            fn({
                type: 'global',
                path: file
            });
        }

    });

}
311256
function normalize$1(path) {
              var isPathAbsolute = isAbsolute(path),
                  trailingSlash = substr(path, -1) === '/';

              // Normalize the path
              path = normalizeArray(filter(path.split('/'), function(p) {
                return !!p;
              }), !isPathAbsolute).join('/');

              if (!path && !isPathAbsolute) {
                path = '.';
              }
              if (path && trailingSlash) {
                path += '/';
              }

              return (isPathAbsolute ? '/' : '') + path;
            }
1060454
function findHash(path) {
			var h, m, len;
			for(h in config.map) {
				var modules = config.map[h];
				for(m = 0, len = modules.length; m < len; m++ ) {
					if(modules[m] === path) return h
				}
			}
			return null;
		}
1113586
function (path) {
        return new Promise((resolve, reject) => {
            fs.access(path, fs.constants.F_OK, (err) => {
                if (err === null) {
                    resolve(true);
                }
                else if (err.code === 'ENOENT') {
                    resolve(false);
                }
                else {
                    reject(err);
                }
            });
        });
    }
279859
function readFile(path) {
  if (!path) {
    throw new Error('The passed file must not be nil to be read.');
  }
  if (!FileUtils.doesFileExist(path)) {
    throw new Error(`The passed file '${path}' must exist and must not be a directory to be read.`);
  }
  return fs.readFileSync(path, 'utf-8').toString();
}
510966
function getFileHash(filePath, callback) {
  var stream = fs.ReadStream(filePath);
  var md5sum = crypto.createHash('md5');

  stream.on('data', function(data) {
    md5sum.update(data);
  });

  stream.on('end', function() {
    callback(md5sum.digest('hex'));
  });
}
1098262
function computeHash(filename, algo, callback) {
    var crypto = require('crypto');
    var fs = require('fs');

    var chksum = crypto.createHash(algo);

    var s = fs.ReadStream(filename);
    s.on('error', function (err) {
        //no file, hash will be zero
        callback(0, err);
    });
    s.on('data', function (d) {
        chksum.update(d);
    });

    s.on('end', function () {
        var d = chksum.digest('hex');
        //util.debug(d + '  ' + filename);
        callback(d);
    });
}
689593
function (path, done) {
            fs.access(path, fs.R_OK, function (error) {
              done(!error)
            })
          }
1046559
function(path, callback){

        fs.exists(path, function(exists){
            if (exists) {
                fs.lstat(path, function(err, stats){
                    if (err) console.error(err.stack);

                    if ( stats.isSymbolicLink() ) fs.unlink(path, function(err){
                        if (err) {
                            console.error(err.stack);
                            callback(err)
                        } else {
                            //Trigger.
                            onSymlinkRemoved(self.paths, function(err){
                                if (err) console.error(err.stack);

                                callback(false)
                            })
                        }
                    })
                })
            } else {
                //log & ignore. This is not a real issue.
                //logger.warn('gina', 'UTILS:CONFIG:WARN:1', 'Path not found: ' + path, __stack);
                console.warn( 'Path not found: ' + path, __stack);
                onSymlinkRemoved(self.paths, function(err){
                    //if (err) logger.error('gina', 'UTILS:CONFIG:ERR:9', err, __stack);
                    if (err) console.error(err.stack||err.message);

                    callback(false)
                })
            }
        })
    }
455116
function removeChecksum(fs, path, callback) {
  removeAttr(fs, path, constants.attributes.checksum, callback);
}
926204
function getFile(path) {
	const
		cache = validateCache(path, filesCache);

	if (!cache.fromCache) {
		filesCache[path] = {
			mtime: cache.mtime,
			content: fs.readFileSync(path, 'utf-8')
		};
	}

	return filesCache[path].content;
}
1121627
@Override
  public int flush(String path, FuseFileInfo fi) {
    LOG.trace("flush({})", path);
    final long fd = fi.fh.get();
    OpenFileEntry oe = mOpenFiles.getFirstByField(ID_INDEX, fd);
    if (oe == null) {
      LOG.error("Cannot find fd for {} in table", path);
      return -ErrorCodes.EBADFD();
    }
    if (oe.getOut() != null) {
      try {
        oe.getOut().flush();
      } catch (IOException e) {
        LOG.error("Failed to flush {}", path, e);
        return -ErrorCodes.EIO();
      }
    } else {
      LOG.debug("Not flushing: {} was not open for writing", path);
    }
    return 0;
  }
1216122
function isSameFile (newFilePath, oldFilePath) {
  const newFileContent = fs.readFileSync(newFilePath, { encoding: 'utf-8' })
  const oldFileContent = fs.readFileSync(oldFilePath, { encoding: 'utf-8' })
  const newHash = md5(newFileContent)
  const oldHash = md5(oldFileContent)

  return newHash === oldHash
}