def listdir(remote_path: Path, extras=False):
    """
    Args: str or Path
    Returns [(path, is_dir), ...]
    """

    search_path = str(remote_path).strip("/")
    search_path = search_path.replace("/", "\\")

    if "*" in search_path:
        raise ValueError(f'Found "*" in {search_path=}, use smb_client.globdir instead')

    if len(search_path) > 0 and not check_exists(search_path):
        raise FileNotFoundError(search_path)
    search_path += "\\*"

    data = run_command_stdout(f"ls {search_path}")
    yield from yield_dirfiles(data, extras, parent=remote_path)

    Args: str or Path
    Returns [(path, is_dir), ...]
    
infinigen/datagen/util/smb_client.py