def build_file_list(path):
    """
    Build a list a list of files (and directories) by iterating recursively
    over the given path
    :param path: The path to iterate over
    :type path: pathlib.Path
    :return: A tuple of directories and files
    :rtype: tuple(list, list)
    """
    dirs = []
    files = []
    for x in path.iterdir():
        try:
            if x.is_symlink():
                continue
            elif x.is_dir():
                dirs.append(x)
                new_dirs, new_files = build_file_list(x)
                dirs.extend(new_dirs)
                files.extend(new_files)
            elif x.is_file():
                files.append(x)
        except PermissionError:
            continue
    return dirs, files