def METHOD_NAME(root, *subpaths, binary=False, dir_only=False):
    """
    Creates a file under the specified subpaths of the given root with the filepath as its content.
    """
    full_path = pathlib.Path(root, *subpaths)
    full_path.parent.mkdir(exist_ok=True, parents=True)
    if not dir_only:
        if binary:
            content = b"\x00"
            full_path.write_bytes(content)
        else:
            content = str(full_path)
            full_path.write_text(content)