from pathlib import Path


def sorted_glob(p: Path, pattern="*"):
    """
    return sorted filenames for matched files.
    """
    names = [x.name for x in p.glob(pattern)]
    names.sort()
    return names