Finds all files named $filename within all assets
dirs and subdirs.
199088
public function findAllFiles($filename)
    {
        $pinfo = pathinfo($filename);
        $extension = $pinfo['extension'];
        $dir = $pinfo['dirname'] == '.' ? '' : $pinfo['dirname'] . '/';
        $file_relative_path_root = $dir . $pinfo['filename'];
        
        $foundFiles = [];
        
        $pattern = $file_relative_path_root . '.' . $extension . '*';
        
        foreach ($this->paths as $assetsRoot) {
            $foundFiles = array_merge($foundFiles, Rails\Toolbox\FileTools::searchFile($assetsRoot, $pattern));
        }
        
        return $foundFiles;
    }
35582
def find_files(root, pattern):
    
    results = []
    for base, dirs, files in os.walk(root):
        matched = fnmatch.filter(files, pattern)
        results.extend(os.path.join(base, f) for f in matched)
    return results
413874
def list_js_files(dir):
    
    for dirpath, dirnames, filenames in os.walk(dir):
        for filename in filenames:
            if is_js_file(filename):
                yield os.path.join(dirpath, filename)
995076
def all_files(file_or_directory):
    ''
    if os.path.isdir(file_or_directory):
        return [os.path.join(dirname, filename)
                for dirname, dirnames, filenames in os.walk(file_or_directory)
                for filename in filenames]
    else:
        return [file_or_directory]
123644
def files_exist(self, filenames):
        
        return all([os.path.exists(os.path.abspath(filename)) and os.path.isfile(os.path.abspath(filename))
                    for filename in filenames])
273576
def get_files(dir_name):
    """"""
    return [(os.path.join('.', d), [os.path.join(d, f) for f in files]) for d, _, files in os.walk(dir_name)]
1167066
def getfiles(qfiles, dirname, names):
    """"""
    for name in names:
        fullname = os.path.join(dirname, name)
        if os.path.isfile(fullname) and \
            fullname.endswith('.cf') or \
                fullname.endswith('.post'):
            qfiles.put(fullname)
1033439
def find_file(filenames)
      return nil if filenames.nil?

      filenames.each_value do |value|
        if value.is_a? Array
          value.each do |file|
            file_path = Utils.lookup_file file
            return file_path unless file_path.nil?
          end
        else
          file_path = Utils.lookup_file value
          return file_path unless file_path.nil?
        end
      end

      nil
    end
518290
def find_files(globs):
	""""""

	last_cwd = os.getcwd()
	os.chdir(config.cwd)

	gex, gin = separate_globs(globs)

	# Find excluded files
	exclude = []
	for glob in gex:
		parse_glob(glob, exclude)

	files = []
	include = []
	order = 0

	# Find included files and removed excluded files
	for glob in gin:
		order += 1
		array = parse_glob(glob, include)
		base = find_base(glob)

		for file in array:
			if file not in exclude:
				files.append((order, base, file))

	os.chdir(last_cwd)
	return files
583624
public function files($dirname)
    {
        $dirname = $this->path($dirname);

        $directory_contents = glob($dirname . "/*");

        return array_filter($directory_contents, function ($file) {
            return filetype($file) == "file";
        });
    }
700687
function findAllCompressionFiles(fs, folderPath) {
        // check if folder exists
        if (!fs.existsSync(folderPath))  return; 
        
        var files = fs.readdirSync(folderPath);
        //iterate all files in the current folder
        for (var i = 0; i < files.length; i++) {
            var filePath = folderPath + "/" + files[i];
            var stats = fs.statSync(filePath);
            if (stats.isDirectory()) {
                //recursively search folders and append the matching files
                findAllCompressionFiles(fs, filePath);
            } else {
                addAllMatchingCompressionsToFile(files[i], filePath);
            }
        }
    }
700347
function getRouteFiles (pathName) {
    var items = fs.readdirSync(pathName);
    var files = [];

    items.forEach(function(itemName) {
        var fullName = path.join(pathName, itemName);
        var fsStat = fs.statSync(fullName);

        // If directory, then scan for "routes.js"
        if (fsStat.isDirectory()) {
            getRouteFiles(fullName).forEach(function(a) {
                files.push(a);
            });
        } else if (fsStat.isFile() && itemName === 'routes.js') {
            // routes.js found, append to list
            files.push(fullName);
        }
    });

    return files;
}
766004
def discover_files(base_path, sub_path='', ext='', trim_base_path=False):
    """"""
    file_list = []
    for root, dirs, files in walk(path.join(base_path, sub_path)):
        if trim_base_path:
            root = path.relpath(root, base_path)
        file_list.extend([path.join(root, file_name)
                          for file_name in files
                          if file_name.endswith(ext)])
    return sorted(file_list)
729666
def get_files (dirname):
    """"""
    for entry in os.listdir(dirname):
        fullentry = os.path.join(dirname, entry)
        if os.path.islink(fullentry):
            continue
        if os.path.isfile(fullentry):
            yield entry
        elif os.path.isdir(fullentry):
            yield entry+"/"
1198819
public function findAllDirs($name, $reload = false, $reversed = false)
	{
		return $this->findAll($name, $reload, $reversed, 'dir');
	}
427601
def __find_source_files(self):
        
        for dir_path, _, files in os.walk(self._source_directory):
            for name in files:
                if name.lower().endswith(self._source_file_extension):
                    basename = os.path.splitext(os.path.basename(name))[0]
                    relative_path = os.path.relpath(os.path.join(dir_path, name))

                    if basename in self._source_file_names:
                        self._io.error("Files '{0}' and '{1}' have the same basename.".
                                       format(self._source_file_names[basename], relative_path))
                        self.error_file_names.add(relative_path)
                    else:
                        self._source_file_names[basename] = relative_path
801673
def find_files_for_use(self, all_files):
        
        for path in all_files:
            # Find the path relative to the parent dir
            relpath = self.relpath_for(path)

            # Don't care about the ./
            if relpath.startswith("./"):
                relpath = relpath[2:]

            # Only care about paths that aren't filtered
            if not self.is_filtered(relpath):
                yield Path(path, relpath)