def listAllFiles (directory, suffix=None, abspath=False):
    """Returns the list of all files within the input directory and
    all subdirectories.
    """
    files = []

    directory = expandPath(directory)

    for dirpath, dirnames, filenames in os.walk(directory, followlinks=True):
        if suffix:
            filenames = [f for f in filenames if f.endswith(suffix)]

        for filename in filenames:
            filepath = os.path.join(dirpath, filename)
            if not abspath:
                filepath = os.path.relpath(filepath, start=directory)

                # os.path.join(path, filename)

            files.append(filepath)

    return files
def listAllFiles ( directory , suffix = None , abspath = False ) : files = [ ] directory = expandPath ( directory ) for dirpath , dirnames , filenames in os . walk ( directory , followlinks = True ) : if suffix : filenames = [ f for f in filenames if f . endswith ( suffix ) ] for filename in filenames : filepath = os . path . join ( dirpath , filename ) if not abspath : filepath = os . path . relpath ( filepath , start = directory ) files . append ( filepath ) return files
Returns the list of all files within the input directory and
    all subdirectories.