import tempfile


def create_named_text_file(dir: str, prefix: str, suffix: str) -> str:
    """
    Create a named unique file.
    """
    fd = tempfile.NamedTemporaryFile(
        mode='w+', prefix=prefix, suffix=suffix, dir=dir, delete=False
    )
    path = fd.name
    fd.close()
    return path