Internal: List directory filenames and associated Stats under an entire
 directory tree.

 See PathUtils#stat_sorted_tree

 dir - A String directory

 Returns an Array of filenames and a Set of dependency URIs.
177163
def stat_sorted_tree_with_dependencies(dir)
      deps = Set.new([build_file_digest_uri(dir)])
      results = stat_sorted_tree(dir).map do |path, stat|
        deps << build_file_digest_uri(path) if stat.directory?
        [path, stat]
      end
      return results, deps
    end
422571
def _list_dir(self):
        
        return [os.path.join(self._path, fn) for fn in os.listdir(self._path)
                if not fn.endswith(self._fs_transaction_suffix)]
114083
def list_filepathes_with_predicate(path_dir, predicate):
    '''
    '''
    if not os.path.isdir(path_dir):
        raise ValueError("{} is not a directory".format(path_dir))
    contents = (os.path.join(path_dir, a) for a in os.listdir(path_dir))
    files = (c for c in contents if os.path.isfile(c))
    return [f for f in files if f.startswith(predicate)]
289965
def dir():
        
        dir = [
            'access', 'chdir', 'chmod', 'chown', 'close', 'fstat', 'fsync',
            'getcwd', 'lchmod', 'link', 'listdir', 'lstat', 'makedirs',
            'mkdir', 'mknod', 'open', 'read', 'readlink', 'remove',
            'removedirs', 'rename', 'rmdir', 'stat', 'symlink', 'umask',
            'unlink', 'utime', 'walk', 'write'
        ]
        if IS_PY2:
            dir += ['getcwdu']
        else:
            dir += ['getcwdb', 'replace']
            if sys.platform.startswith('linux'):
                dir += [
                    'fdatasync', 'getxattr', 'listxattr',
                    'removexattr', 'setxattr'
                ]
        if use_scandir:
            dir += ['scandir']
        return dir
426879
def list_directories_in_directory(full_directory_path):
    
    directories = list()
    for directory_name in __os.listdir(full_directory_path):
        if __os.path.isdir(__os.path.join(full_directory_path, directory_name)):
            directories.append(directory_name)
    return directories
1095197
function readdir(path) {
	var stats = fs.lstatSync(path);
	var files = null;
	if (stats.isDirectory()) {
		fileNames = fs.readdirSync(path);
		files = _.map(fileNames, function(f) { return path + '/' + f; });
	} else {
		files = [];
	}
	return files;
}
1283540
def find_directories(root,fullpath=True):
    '''
    
    '''
    directories = []
    for item in os.listdir(root):
        # Don't include hidden directories
        if not re.match("^[.]",item):
            if os.path.isdir(os.path.join(root, item)):
                if fullpath:
                    directories.append(os.path.abspath(os.path.join(root, item)))
                else:
                    directories.append(item)
    return directories
145752
function paths(dir) {
	var paths = [];

	try {
		fs.statSync(dir);
	}
	catch (e) {
		return e;
	}

	(function traverse(dir, stack) {
		stack.push(dir);
		fs.readdirSync(stack.join('/')).forEach(function(file) {
			var path = stack.concat([file]).join('/'),
				stat = fs.statSync(path);

			if (file[0] == '.' || file === 'vendor') {
				return;
			} else if (stat.isFile() && /\.js$/.test(file)) {
				paths.push(path);
			} else if (stat.isDirectory()) {
				paths.push(path);
				traverse(file, stack);
			}
		});
		stack.pop();
	})(dir || '.', []);

	return paths;
}
768749
def _recursive_get_all_file_names(dir):
    
    if not dir:
        return []

    result = []
    for basedir, dirs, files in os.walk(dir):
        result.extend(files)

    return result
193866
public static List<String> getDirectoryNames(String root, boolean fullPath) {
        List<File> fileList = getDirectoriesByName(root);
        List<String> list = new ArrayList<String>(fileList.size());

        for (File f : fileList) {
            String name = fullPath ? f.getAbsolutePath() : f.getName();
            list.add(name);
        }

        return list;
    }
284003
def _file_list(self, folder):
        ''''''
        rtn = []
        walk = self._walk_report(folder)
        for key,val in walk.items():
            for v in val:
                x=os.path.join(key,v)
                rtn.append(x)

        self.file_count = len(rtn)  #a count of the files we'll have in the final cleaned sosreport, for reporting
        return rtn
852456
function readDir(dir) {
    var files = [];
    var root = fs.readdirSync(dir);
    var readMe = false;
    for (var i = 0; i < root.length; i++) {
        var filePath = dir + '/' + root[i];
        var stat = fs.statSync(filePath);
        //console.log(filePath,dir);
        filePath = path.relative(dir, filePath);
        if (stat && stat.isDirectory()) {
            files.push({
                dir: true,
                path: filePath
            });
        } else {
            files.push({
                dir: false,
                path: filePath
            });
        }

        // check if it is readme
        if(root[i].toLowerCase() === 'readme.md'){
            readMe = dir + '/' + root[i];
        }
    }
    return {
        files: files,
        readMe : readMe
    };
}
630444
def DirectoriesRelative(self):
        
        # Acquire all directories
        directories = itertools.chain(self.Directories, (os.path.dirname(f) for f in itertools.chain(self.ContentFiles, self.CompileFiles)))
        directories = set(os.path.relpath(d, self.ProjectHome) for d in directories)

        # We need separate entries for parent directories of directories in the list
        for path in set(directories):
            subpath = os.path.dirname(path)
            while subpath:
                directories.add(subpath)
                subpath = os.path.dirname(subpath)

        return sorted(directories)
528062
def ordered_dirs(self):
        
        return [item[0] for item in sorted(
            self.byte_contents.items(), key=lambda entry: entry[1].st_ino)]
1056517
def listdir(*paths, glob=None):
    '''
    
    '''
    path = genpath(*paths)

    names = os.listdir(path)
    if glob is not None:
        names = fnmatch.filter(names, glob)

    retn = [os.path.join(path, name) for name in names]
    return retn
471083
private ArrayList<String> getFiles(String dir, String subDir) {
    ArrayList<String> files = new ArrayList<>();
    String fullDir = subDir == null ? dir : dir + File.separator + subDir;
    File[] listOfFiles = (new File(fullDir)).listFiles();
    if (listOfFiles != null) {
      for (File file : listOfFiles) {
        String fullName = subDir == null ? file.getName() : subDir + File.separator + file.getName();
        if (file.isFile()) {
          files.add(fullName);
        } else if (file.isDirectory()) {
          files.addAll(getFiles(dir, fullName));
        }
      }
    }
    return files;
  }
788509
function getDirectories(source) {
  const isDirectory = sourcePath => lstatSync(sourcePath).isDirectory()
  return readdirSync(source)
    .map(name => join(source, name))
    .filter(isDirectory)
}