Determine whether a file exists.

    http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/exists_c.html

    :param fname: Name of the file in question.
    :return: True if the file exists, False otherwise.
    :rtype: bool
488098
def exists(fname):
    
    fname = stypes.stringToCharP(fname)
    return bool(libspice.exists_c(fname))
77513
public boolean fnameExists(final String fname) {
        boolean rslt = false; // default
        try {
            final ITenant tenant = getTenantByFName(fname);
            rslt = tenant != null;
        } catch (IllegalArgumentException iae) {
            // This exception is completely fine;  it simply
            // means there is no tenant with this fname.
            rslt = false;
        }
        return rslt;
    }
740971
def _find_file(filename):
    
    import os
    if os.path.exists(filename):
        path = filename
    else:
        path = os.path.dirname(__file__)
        path = os.path.join(path, 'data', filename)

    if not os.path.exists(path):
        raise ValueError("cannot locate file '%s'" %filename)

    return path
524716
def file_exists(original_file):
    
    s3 = boto3.resource('s3')
    bucket_name, object_key = _parse_s3_file(original_file)
    bucket = s3.Bucket(bucket_name)
    bucket_iterator = bucket.objects.filter(Prefix=object_key)
    bucket_list = [x for x in bucket_iterator]
    logger.debug("Bucket List: {0}".format(", ".join([x.key for x in bucket_list])))
    logger.debug("bucket_list length: {0}".format(len(bucket_list)))
    return len(bucket_list) == 1
487494
def check_file_existence(path):
    

    pathvalidate.validate_file_path(path)

    if not os.path.lexists(path):
        raise FileNotFoundError(path)

    if os.path.isfile(path):
        logger.debug("file found: " + path)
        return FileType.FILE

    if os.path.isdir(path):
        logger.debug("directory found: " + path)
        return FileType.DIRECTORY

    if os.path.islink(path):
        logger.debug("link found: " + path)
        return FileType.LINK

    raise RuntimeError()
804197
public boolean isFile(Path f) throws IOException {
    try {
      return !getFileStatus(f).isDir();
    } catch (FileNotFoundException e) {
      return false;               // f does not exist
    }
  }
155455
public function exists($name): bool
    {
        $filename = $this->getFilename($name);
        if ($filename === false) {
            return false;
        }

        return true;
    }
872281
def _file_exists(path, filename):
  """"""
  return os.path.isfile(os.path.join(path, filename))
186930
def exists(self, filename):
        """"""
        client = boto3.client("s3")
        bucket, path = self.bucket_and_path(filename)
        r = client.list_objects(Bucket=bucket, Prefix=path, Delimiter="/")
        if r.get("Contents") or r.get("CommonPrefixes"):
            return True
        return False
22312
def file_is_present(self, file_path):
        
        p = self.p(file_path)
        if not os.path.exists(p):
            return False
        if not os.path.isfile(p):
            raise IOError("%s is not a file" % file_path)
        return True
579111
def checkFileExists(filename, directory=None):
    

    if directory is not None:
        fname = os.path.join(directory,filename)
    else:
        fname = filename
    _exist = os.path.exists(fname)
    return _exist
1255129
public boolean exists(Path filename) throws IOException {
    try {
      return getMfs().listFiles(filename, true).hasNext();
    } catch (FileNotFoundException e) {
      return false;
    }
  }
708022
def _check_config_exists(config_file=None):
    '''
    
    '''
    if config_file is None:
        config_file = _config_file()
    if not os.path.isfile(config_file):
        return False
    return True
445159
def file_exists?(paths, file)
      paths.any? do |path|
        Find.find(path)
            .map { |path_file| Shellwords.escape(path_file) }
            .include?(file)
      end
    end
381835
def _one_exists(input_files):
    
    for f in input_files:
        if os.path.exists(f):
            return True
    return False
737997
public static function fileExists($fileName)
    {
        $fp = @fopen($fileName, 'r', true);
        if (is_resource($fp)) {
            fclose($fp);
            return true;
        }
        return false;
    }
155177
def is_file_exists_error(e):
    
    if six.PY3:
        return isinstance(e, FileExistsError)  # noqa: F821
    else:
        return isinstance(e, OSError) and e.errno == 17