Checks if a path exists

@param filePath - file path to check
@returns {boolean} - does the file path exist?
769404
function isPathAccessible (filePath) {
  try {
    fs.accessSync(filePath)
    debug(`Utils: isPathAccessible(): ${filePath} exists`)
    return true
  } catch (err) {
    debug(`Utils: isPathAccessible(): ${filePath} does not exist`)
    return false
  }
}
170924
public boolean exist(String path) {
		final String fileName = FileUtil.getName(path);
		final String dir = StrUtil.removeSuffix(path, fileName);
		final List<String> names = ls(dir);
		return containsIgnoreCase(names, fileName);
	}
1327333
def exists(self, filepath):
        """"""
        if self.is_ssh(filepath):
            self._check_ftp()
            remotepath = self._get_remote(filepath)
            try:
                self.ftp.stat(remotepath)
            except IOError as e:
                if e.errno == errno.ENOENT:
                    return False
            else:
                return True
        else:
            return os.path.exists(filepath)
866082
function isFileExtension(filepath, extension) {
			return typeof filepath === 'string' && path.extname(filepath) === extension && fs.existsSync(filepath) &&
				fs.lstatSync(filepath).isFile()
				;
		}
317612
function fileChecks( filepath )
		{
			// check if file exists
			if (!grunt.file.exists(filepath))
			{
				grunt.log.warn('Source file "' + filepath + '" not found');
				return false;
			}

			if(options.checkFilesize)
			{
				// check for size
				var stats = fs.lstatSync( filepath );

				if(stats.size > UNCRITICAL_FILE_SIZE)
				{
					grunt.log.warn('uncritical datauri size (' + filesize(UNCRITICAL_FILE_SIZE) + ') exceeded: ' + filepath + ' (' + filesize(stats.size) + ')');
				}
			}

			return true;
		}
399648
function(filePath, currentPath){
	if(/^(?:\/|[a-zA-Z]:(?:\/|\\))/.test(filePath)){ // Is the path absolute?
		filePath = path.normalize(filePath);
	}else{ // Relative paths need to be resolved first
		filePath = path.resolve(currentPath, filePath);
	}
	return filePath;
}
1215973
function fileExists(fileName) {
        if (!fileName) {
            return false;
        }

        var filePath = PathUtils.resolveInRoot(outputFolder, fileName);
        return fs.existsSync(filePath);
    }
790974
function fileExists(file) {
    try {
        var targetStat = fs.statSync(file);
        if (targetStat.isDirectory() ) {
            throw new Error("File exists but it's a driectory: " + file);
        }
    }
    catch(err) {
        if (err.code == 'ENOENT') {         // No such file or directory
            return false;
        }
        else {
            throw err;
        }
    }
    return true;
}
382894
function exists(file, src, opts) {
	var files = opts.path.map(function (dir) {
		return path.join(dir, file);
	});

	files = globby.sync(files);

	if (!files.length) {
		throw new Error(createError(file, src, opts.path));
	}

	return files[0];
}
581386
def _cs_path_exists(fspath):
        
        if not os.path.exists(fspath):
            return False
        # make absolute so we always have a directory
        abspath = os.path.abspath(fspath)
        directory, filename = os.path.split(abspath)
        return filename in os.listdir(directory)
1269986
function (path) {
    if (fs.existsSync(path) && fs.statSync(path).isDirectory()) {
      return true;
    }
    return false;
  }
387015
def exists(self, path):
    
    if self._json is None:
      return False

    node = self._json
    path_arr = path.split('.')
    while len(path_arr) > 0:
      path_item = path_arr.pop(0)
      if path_item in node and len(path_arr) == 0:
        return True
      elif path_item in node and len(path_arr) > 0:
        node = node[path_item]
      else:
        return False

    return False
1254266
def check_file_path(self, path):
        
        if os.path.exists(path) is not True:
            msg = "File Not Found {}".format(path)
            raise OSError(msg)
447741
function exists(fileOrDir) {
  let stats;
  try {
    stats = statSync(fileOrDir);
    return stats.isFile() || stats.isDirectory();
  } catch (err) {
    return false;
  }
}
152383
function caseSensiveFileExits(filepath) {
  var dir = path.dirname(filepath);
  var basename = path.basename(filepath);

  var filenames = fs.readdirSync(dir);
  if (~filenames.indexOf(basename)) {
    return true;
  }

  return false;
}
749126
public static function fileExistsSafe(string $filePath) : bool
    {
        if ($filePath == '') {
            return false;
        }

        if (DirHelper::isDirSafe($filePath)) {
            return false;
        }

        return file_exists($filePath);
    }
388091
def exists(self, path):
        
        (bucket, key) = self._path_to_bucket_and_key(path)

        # root always exists
        if self._is_root(key):
            return True

        # file
        if self._exists(bucket, key):
            return True

        if self.isdir(path):
            return True

        logger.debug('Path %s does not exist', path)
        return False