INNER CODE UNIT · Python

rel

uxlfoundation/oneDAL · dev/release_tests/compare_release_trees.py:307

def rel(path, root):
    return path.relative_to(root).as_posix()


def classify(root):
    dirs = set()
    files = set()
    links = {}

    for current, dirnames, filenames in os.walk(root, followlinks=False):
        current_path = Path(current)
        for dirname in dirnames:
            path = current_path / dirname
            rel_path = rel(path, root)
            if path.is_symlink():
                links[rel_path] = os.readlink(path)
            else:
                dirs.add(rel_path)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…