Check that file list is not empty and contains only existing files.
499885
def check_archive_filelist (filenames):
    """"""
    if not filenames:
        raise PatoolError("cannot create archive with empty filelist")
    for filename in filenames:
        check_existing_filename(filename, onlyfiles=False)
106292
public function hasFiles($onlySuccessful = true)
    {
        $context = $this->_context;

        /** @var $_FILES array */
        foreach ($context->_FILES as $file) {
            if (is_int($file['error'])) {
                $error = $file['error'];

                if (!$onlySuccessful || $error === UPLOAD_ERR_OK) {
                    return true;
                }
            } else {
                /** @noinspection ForeachSourceInspection */
                foreach ($file['error'] as $error) {
                    if (!$onlySuccessful || $error === UPLOAD_ERR_OK) {
                        return true;
                    }
                }
            }
        }

        return false;
    }
345756
def validate_data_files(problem, data_files, min_size):
  """"""
  # Check that all files are present
  data_dir = os.path.split(data_files[0])[0]
  out_filepaths = problem.out_filepaths(data_dir)
  missing_filepaths = set(out_filepaths) - set(data_files)
  if missing_filepaths:
    tf.logging.error("Missing %d data files", len(missing_filepaths))

  # Check that each file is at least 100M
  too_small = []
  for data_file in data_files:
    length = get_length(data_file)
    if length < min_size:
      too_small.append(data_file)
  if too_small:
    tf.logging.error("%d files too small", len(too_small))

  bad_files = too_small + list(missing_filepaths)
  return bad_files
605754
private boolean checkFilesExists(String[] requiredFiles, File childResource) {

        File setupFile = null;
        boolean hasMissingSetupFiles = false;

        for (int j = 0; j < requiredFiles.length; j++) {
            setupFile = new File(childResource.getPath() + File.separatorChar + requiredFiles[j]);

            if (!setupFile.exists() || !setupFile.isFile() || !setupFile.canRead()) {
                hasMissingSetupFiles = true;
                System.err.println(
                    "[" + getClass().getName() + "] missing or unreadable database setup file: " + setupFile.getPath());
                break;
            }

            if (!hasMissingSetupFiles) {
                return true;
            }
        }
        return false;
    }
381835
def _one_exists(input_files):
    
    for f in input_files:
        if os.path.exists(f):
            return True
    return False
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
994783
def _HasFile(self, file_name):
    """"""
    if self._zip:
      return file_name in self._zip.namelist()
    else:
      file_path = os.path.join(self._path, file_name)
      return os.path.exists(file_path) and os.path.isfile(file_path)
71869
private void refreshFileList()
      throws IOException {
    FileStatus[] files = fileSystem.globStatus(inputDirectoryAndPattern);
    for (FileStatus file : files) {
      String fileName = file.getPath().getName();
      if (!knownFileSet.contains(fileName)) {
        if (endFileNumber != -1) {
          // Sanity check against endFileNumber.
          int newFileIndex = parseFileIndex(fileName);
          Preconditions.checkState(newFileIndex < endFileNumber,
              "Found new file '%s' with index %s, which isn't less than endFileNumber %s!",
              fileName, newFileIndex, endFileNumber);
        }

        logger.atInfo().log(
            "Adding new file '%s' of size %s to knownFileSet.", fileName, file.getLen());
        knownFileSet.add(fileName);
        fileQueue.add(file);
      }
    }
  }
682203
def contains_list(longer, shorter):
    """"""
    if len(longer) <= len(shorter):
        return False
    for a, b in zip(shorter, longer):
        if a != b:
            return False
    return True
823987
def checkfiles(args):
  """"""

  from .query import Database
  db = Database()

  r = db.objects()

  # go through all files, check if they are available on the filesystem
  good = []
  bad = []
  for f in r:
    if os.path.exists(f.make_path(args.directory, args.extension)):
      good.append(f)
    else:
      bad.append(f)

  # report
  output = sys.stdout
  if args.selftest:
    from bob.db.utils import null
    output = null()

  if bad:
    for f in bad:
      output.write('Cannot find file "%s"\n' % (f.make_path(args.directory, args.extension),))
    output.write('%d files (out of %d) were not found at "%s"\n' % \
      (len(bad), len(r), args.directory))

  return 0
424899
def validate(self, path):
        """"""
        # Exclude hidden files and folders with '.' prefix
        if os.path.basename(path).startswith('.'):
            return False

        # Check that current path level is more than min path and less than max path
        if not self.check_level(path):
            return False

        if self.filters:
            if not self._level_filters(path):
                return False

        # Force include and exclude iterations to be strings in case of integer filters
        # Handle exclusions
        if self.to_exclude:
            if any(str(ex).lower() in path.lower() for ex in self.to_exclude):
                return False

        # Handle inclusions
        if self.to_include:
            if not any(str(inc).lower() in path.lower() for inc in self.to_include):
                return False

        return True
865653
def files(self, data):
        """"""
        current_files = self.files
        if current_files:
            raise RuntimeError('Can not update existing files.')
        for key in data:
            current_files[key] = data[key]
711865
public boolean containsFile(File f) {
		return unchangedFiles.contains(f) || newFiles.contains(f)
				|| updatedFiles.contains(f) || deletedFiles.contains(f)
				|| recursedDirectories.contains(f)
				|| failedTransfers.containsKey(f);
	}
108592
def check_dir(directory, newly_created_files):
  """"""
  header_parse_failures = []
  for root, dirs, files in os.walk(directory):
    for f in files:
      if f.endswith('.py') and os.path.basename(f) != '__init__.py':
        filename = os.path.join(root, f)
        try:
          check_header(filename, filename in newly_created_files)
        except HeaderCheckFailure as e:
          header_parse_failures.append(e.message)
  return header_parse_failures
1017700
function checkRequiredFiles(files) {
  try {
    files.forEach(filePath => {
      fs.accessSync(filePath, fs.F_OK);
    });
    return true;
  } catch (err) {
    return false;
  }
}
591256
def not_files(self):
        """"""

        _args = []

        for arg in self.all:
            if not len(_expand_path(arg)):
                if not os.path.exists(arg):
                    _args.append(arg)

        return ArgsList(_args, no_argv=True)
369165
def _check_input_files(nspc, parser):
        """"""
        if not len(nspc.filenames) == 3:
            parser.print_help()
            msg = """
      3 Expected files; Expected content: study population association",
      {} Actual   files: {}""".format(len(nspc.filenames), ' '.join(nspc.filenames))
            raise Exception(msg)
        for fin in nspc.filenames:
            if not os.path.exists(fin):
                return "*{}* does not exist".format(fin)

        return False