opendir should use getContentsOfDirectory and loop through to call basename for each element.