Return a list of filenames for given iRODS path (recursively)
197721
def ifiles(irods_path):
    """"""
    raw_output = subprocess.check_output(
        "ils -r --bundle {0}"
        "    | grep 'Bundle file:'"
        "    | awk '{{print $3}}'".format(irods_path),
        shell=True
    )
    filenames = raw_output.decode('ascii').strip().split("\n")
    return filenames
303409
def _get_filepaths(self):
        """"""
        self._printer(str(self.__len__()) + " file paths have been parsed in " + str(self.timer.end))
        if self._hash_files:
            return pool_hash(self.filepaths)
        else:
            return self.filepaths
1169967
def list_distinfo_files(self):
        
        base = os.path.dirname(self.path)
        for path, checksum, size in self._get_records():
            # XXX add separator or use real relpath algo
            if not os.path.isabs(path):
                path = os.path.join(base, path)
            if path.startswith(self.path):
                yield path
514282
def filenames(self):
        """"""
        return [p.name for p in self.packets if isinstance(p, FileDescriptionPacket)]
1245013
def list(cls, path):
        
        file_info = cls.parse_remote(path)
        connection = cls.connect(path)
        bucket = connection.get_bucket(file_info.bucket)
        region = "@%s" % file_info.region if file_info.region else ""

        output = []
        for key in bucket.get_all_keys(prefix=file_info.key):
            output.append(cls._S3_FILE % {"bucket": file_info.bucket,
                                          "key": key.name,
                                          "region": region})
        return output
451002
def paths(self):
        """"""
        if self.format is None:
            raise ArcanaFileFormatError(
                "Cannot get paths of fileset ({}) that hasn't had its format "
                "set".format(self))
        if self.format.directory:
            return chain(*((op.join(root, f) for f in files)
                           for root, _, files in os.walk(self.path)))
        else:
            return chain([self.path], self.aux_files.values())
100989
def _get_files(path):
        
        ret_val = []
        for root, _, files in os.walk(path):
            for f in files:
                ret_val.append(os.path.join(root, f))
        return ret_val
733165
def list(path='.'):
    """"""
    import os
    for f in os.listdir(path):
        if isfile(join(path, f)):
            yield join(path, f) if path != '.' else f
674761
def RDirs(self, pathlist):
        """"""
        cwd = self.cwd or self.fs._cwd
        return cwd.Rfindalldirs(pathlist)
71604
def recursively_get_files_from_directory(directory):
    
    return [
        os.path.join(root, filename)
        for root, directories, filenames in os.walk(directory)
        for filename in filenames
    ]
326441
def all_files_in_directory(path):
    
    file_list = []
    for dirname, dirnames, filenames in os.walk(path):
        for filename in filenames:
            file_list.append(os.path.join(dirname, filename))
    return file_list
1280924
def list_files(path, extension=".cpp", exclude="S.cpp"):
    """"""
    return ["%s/%s" % (path, f) for f in listdir(path) if f.endswith(extension) and (not f.endswith(exclude))]
256246
def list_files(dir_path, recursive=True):
    

    for root, dirs, files in os.walk(dir_path):
        file_list = [os.path.join(root, f) for f in files]
        if recursive:
            for dir in dirs:
                dir = os.path.join(root, dir)
                file_list.extend(list_files(dir, recursive=True))
        return file_list
210902
def list(self, relpattern):
        ""
        
        parent_path = os.path.dirname(relpattern)
        file_pattern = os.path.basename(relpattern)
        parent = self._resolve_path(parent_path)
        
        if parent is None:
            return []
        else:
            return [os.path.join(parent_path, name) 
                    for (name, mode, sha) in parent.iteritems() 
                    if fnmatch(name, file_pattern)]
1313799
def listdirs(path='.'):
    """"""
    import os
    for f in os.listdir(path):
        if isdir(join(path, f)):
            yield join(path, f) if path != '.' else f
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)
918985
def ls(name, path):
    
    with Session() as session:
        try:
            print_wait('Retrieving list of files in "{}"...'.format(path))
            result = session.VFolder(name).list_files(path)
            if 'error_msg' in result and result['error_msg']:
                print_fail(result['error_msg'])
                return
            files = json.loads(result['files'])
            table = []
            headers = ['file name', 'size', 'modified', 'mode']
            for file in files:
                mdt = datetime.fromtimestamp(file['mtime'])
                mtime = mdt.strftime('%b %d %Y %H:%M:%S')
                row = [file['filename'], file['size'], mtime, file['mode']]
                table.append(row)
            print_done('Retrived.')
            print(tabulate(table, headers=headers))
        except Exception as e:
            print_error(e)