Lists the files in a directory.

        Params:
        * commit: A tuple, string, or Commit object representing the commit.
        * path: The path to the directory.
        * recursive: If True, continue listing the files for sub-directories.
170808
def list_file(self, commit, path, recursive=False):
        
        req = proto.ListFileRequest(
            file=proto.File(commit=commit_from(commit), path=path)
        )
        res = self.stub.ListFile(req, metadata=self.metadata)
        file_infos = res.file_info

        if recursive:
            dirs = [f for f in file_infos if f.file_type == proto.DIR]
            files = [f for f in file_infos if f.file_type == proto.FILE]
            return sum([self.list_file(commit, d.file.path, recursive) for d in dirs], files)

        return list(file_infos)
1114316
def _parse_path(self, path):
        
        paths = path.split('/')
        current_path = paths[0]
        for p in paths[1:]:
            current_path = "{}/{}".format(current_path, p)
            if not self.map.get(current_path): # Create any folders that might not exist yet
                self._commit(current_path, p)
782644
def listFiles(self):
        
        def fn(dirName, level, files):
            if level == self.levelNo-1:
                for fileName in os.listdir(dirName):
                    if fileName != "lock":
                        absFileName = os.path.join(dirName, fileName)
                        files.append(absFileName)
            else:
                for subDir in os.listdir(dirName):
                    if subDir != "lock":
                        absDirName = os.path.join(dirName, subDir)
                        assert os.path.isdir(absDirName)
                        fn(absDirName, level+1, files)
        files = []
        fn(self.rootDir, 0, files)
        return files
996310
def get_file_list(path):
    
    f_list = []
    def recur_dir(path, newpath = os.path.sep):
        files = os.listdir(path)
        for fle in files:
            f_path = cpjoin(path, fle)
            if os.path.isdir(f_path): recur_dir(f_path, cpjoin(newpath, fle))
            elif os.path.isfile(f_path): f_list.append(get_single_file_info(f_path, cpjoin(newpath, fle)))

    recur_dir(path)
    return f_list
13359
def list_files_in_directory(full_directory_path):
    
    files = list()
    for file_name in __os.listdir(full_directory_path):
        if __os.path.isfile(__os.path.join(full_directory_path, file_name)):
            files.append(file_name)
    return files
149481
def _list_files_in_path(path, pattern="*.stan"):
    

    results = []
    for dirname, subdirs, files in os.walk(path):
        for name in files:
            if fnmatch(name, pattern):
                results.append(os.path.join(dirname, name))
    return(results)
309742
def find_file_paths(self):
        
        paths = []
        for root, dirs, files in os.walk(self.directory, topdown=True):
            rel_path = os.path.relpath(root, self.directory)
            for f in files:
                if rel_path == '.':
                    path = (f, os.path.join(root, f))
                else:
                    path = (os.path.join(rel_path, f), os.path.join(root, f))
                paths.append(path)
        return paths
541737
def _list_files(self, path):
        """"""
        files = []
        for f in glob.glob(pathname=path):
            files.append(f)
        files.sort()
        return files
890517
def add(self, paths, **params):
        
        log = self._getparam('log', self._discard, **params)
        missing = self._getparam('missing', True, **params)
        commit = self._getparam('commit', True, **params)

        if type(paths) is not list:
            paths = [paths]

        rebuild = False
        for path in paths:
            if path in self.paths:
                if self.paths[path] == missing:
                    log.info("Ignoring attempt to add existing path %r", path)
                else:
                    log.debug("Changing missing state from %s to %s on existing path %r",
                            str(self.paths[path]), str(missing), path)
                    self.paths[path] = missing
            else:
                log.debug("Adding path %r", path)
                self.paths[path] = missing
                rebuild = True
        if commit and rebuild:
            self.commit(**params)
206091
def commits?(path)
      res = false
      Dir.chdir(path) do
        _stdout, _stderr, exit_status = Open3.capture3( "git rev-parse HEAD" )
        res = (exit_status.to_i.zero?)
      end
      res
    end
561229
def list_files(self, node=None):
        

        return [file_node.path for file_node in self.list_file_nodes(node) if file_node.path]
216981
def file_catalog(self):
        
        pathway = os.path.split(self.filename)
        self.catalog = sorted(os.listdir(pathway[0]))
251370
def get_cached_commit_times(root_folder, parent_dir, sorted_relpaths):
    
    result = get_all_cached_commit_times(root_folder)

    for item in result:
        if sorted(item.get("sorted_relpaths", [])) == sorted_relpaths and item.get("parent_dir") == parent_dir:
            return item.get("commit"), item.get("commit_times")

    return None, {}
543301
def commit(filename):
    
    try:
        repo = Repo()
        # gitcmd = repo.git
        # gitcmd.commit(filename)
        index = repo.index
        index.commit("Updated file: {0}".format(filename))
    except Exception as e:
        print("exception while commit: %s" % e.message)
251060
def _recursive_search_file_in_directory(self, directory, searched_file):
        
        s = os.path.split(searched_file)

        for root, dirs, files in os.walk(directory):
            for file in files:
                # If filename is the same
                if s[1] == file and (s[0] == '' or s[0] == os.path.basename(root)):
                    path = os.path.normpath(os.path.join(root, s[1]))
                    if os.path.exists(path):
                        return path
        return None
984064
def current_files
      if commit_range.is_range?
        execute("git #{git_directory_params} -c diff.renames=0 -c diff.renameLimit=1000 diff -M -C -c --name-only --ignore-submodules=all --diff-filter=AM #{encoding_opt} #{default_params} #{commit_range.to_s}") do |result|
          filter_files(result.to_s.split(/\n/))
        end
      else
        submodules = current_submodules
        execute("git #{git_directory_params} ls-tree -r #{commit_range.to_s} --name-only") do |result|
          filter_files(result.to_s.split(/\n/).select { |f| !submodules.index(f) })
        end
      end
    end
579714
def path_file_to_list(path_file):
    
    paths = []
    path_file_fd = file(path_file)

    for line_no, line in enumerate(path_file_fd.readlines(), start=1):
        line = line.strip()

        if not line:
            # Blank line support
            continue

        if line.startswith('#'):
            # Comment support
            continue

        try:
            is_valid_path(line)
            paths.append(line)
        except ValueError, ve:
            args = (ve, path_file, line_no)
            raise ValueError('%s error found in %s:%s.' % args)

    return paths