def _traverse_tree(t, parent_path):
    """Returns a list of all names in a tree."""
    assert not parent_path or parent_path[-1] == "/"
    full_node_name = parent_path + t.name
    if t.is_file():
        result = [full_node_name]
    else:
        name_prefix = full_node_name + "/"
        result = [name_prefix]
        for i in t.children:
            result.extend(_traverse_tree(i, name_prefix))
    return result